git通常push的流程就是:
git add filename
git commit -m "push remark"
git push origin branchname
其中git add
就是对文件添加索引的,git commit
是提交到本地代码库,也就是提交到缓存,然后git push
就是提交到远程仓库了。
假如想取消追踪的话,就需要鱼腥下面的命令:
git rm --cached filename
git commit -m "remark"
git push origin master
这样子就行了,假如想一直忽略这个文件,每次git add *
的时候忽略它,那么就用.gitignore
文件。方法在我之前的文章里,附上链接:
git忽略本地文件
大致就这些了。