美文网首页
github ignore设置无效的解决方式

github ignore设置无效的解决方式

作者: JoeSense | 来源:发表于2018-07-09 12:37 被阅读0次

stackoverflow答案

Even if you haven't tracked the files so far, git seems to be able to "know" about them even after you add them to .gitignore.
NOTE : First commit your current changes, or you will lose them.
Then run the following commands from the top folder of your git repo:

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

也可以做成脚本,在项目根目录下执行。(记得先把本地代码提交)

#!/bin/sh

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

相关文章

网友评论

      本文标题:github ignore设置无效的解决方式

      本文链接:https://www.haomeiwen.com/subject/qqwzuftx.html