加入gitignore文件没有起作用怎么办

步骤一:

假设有未提交的文件先提交到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


posted @ 2016-03-28 12:53  phlsheji  阅读(659)  评论(0编辑  收藏  举报