首页 > 技术文章 > 加入gitignore文件没有起作用怎么办

bhlsheji 2016-03-28 12:53 原文

步骤一:

假设有未提交的文件先提交到Git。

步骤二:

在Git根文件夹下运行以下的Git命令:

git rm -r --cached .
git add .
git commit -m "fixed untracked files”

tips:

能够在https://www.gitignore.io/里自己主动生成.gitignore文件。

(注意生成的文件名称为gitignore,前面没有点。在移到项目文件夹前记得改名为.gitignore)


參考资料:.gitignore does not work


推荐阅读