git更新.gitignore文件

版权声明:经验之谈,不知能否换包辣条,另,转载请注明出处。 https://blog.csdn.net/zhezhebie/article/details/81664539
 git rm --cached .gitignore
 git status
 git add  .gitignore
 git commit -m "update .gitignore"
 git push

之前看有个朋友写git rm –cached .,这是不对的,这样会把所有缓存的文件都给删除掉!千万不要随意rm文件。

强制使用远程分支覆盖本地分支:

git fetch --all
git reset --hard origin/test_branch (这里master要修改为对应的分支名)
git pull

猜你喜欢

转载自blog.csdn.net/zhezhebie/article/details/81664539