4

git 修改.gitignore后生效

 1 year ago
source link: https://blog.csdn.net/mingjie1212/article/details/51689606
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

git 修改.gitignore后生效

original.png
mingjie1212 newCurrentTime2.png 于 2016-06-16 09:50:56 发布 articleReadEyes2.png 43495
分类专栏: # Linux 文章标签: git

在使用git的时候我们有时候需要忽略一些文件或者文件夹。我们一般在仓库的根目录创建.gitignore文件

在提交之前,修改.gitignore文件,添加需要忽略的文件。然后再做add  commit push 等

但是有时在使用过称中,需要对.gitignore文件进行再次的修改。这次我们需要清除一下缓存cache,才能是.gitignore 生效。

具体做法:

git rm -r --cached .  #清除缓存
git add . #重新trace file
git commit -m "update .gitignore" #提交和注释
git push origin master #可选,如果需要同步到remote上的话

这样就能够使修改后的.gitignore生效。
文章知识点与官方知识档案匹配,可进一步学习相关知识
Git技能树首页概览4362 人正在系统学习中

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK