Git忘记弄.gitignore文件

使用.gitignore文件删除掉已经提交的文件

顺序依次执行如下命令:

First commit any outstanding code changes, and then, run this command:

git rm -r --cached .

This removes any changed files from the index(staging area), then just run:

git add .

Commit it:

git commit -m ".gitignore is now working"

最后提交到远程仓库,会发现.gitignore文件起作用了。

猜你喜欢

转载自blog.csdn.net/qq_26878363/article/details/81947112