有时我们上传github项目时,发现.gitingore虽然改变了,但是好像文件没有生效,这种问题是因为我们本地仓库出现缓存,应先清理缓存,在进行提交。如下:
git rm -r --cached
git add .
git commit -m "update iginore"
git push
.gitignore文件的使用
*.yml 忽略所有以yml结尾的文件
doc/**/*.txt 忽略doc下的所有以txt结尾的文件
target 忽略target文件
有时我们上传github项目时,发现.gitingore虽然改变了,但是好像文件没有生效,这种问题是因为我们本地仓库出现缓存,应先清理缓存,在进行提交。如下:
git rm -r --cached
git add .
git commit -m "update iginore"
git push
.gitignore文件的使用
*.yml 忽略所有以yml结尾的文件
doc/**/*.txt 忽略doc下的所有以txt结尾的文件
target 忽略target文件