dre*_*att 13 git atlassian-sourcetree
在测试/推送到生产时不断更改我的web.config文件变旧,所以当我不更改文件时,必须记住从我的暂存更改中删除它.
我尝试使用Sourcetree中的"停止跟踪"选项(我认为将该文件添加到我的GitIgnore),但看起来它会从我的远程仓库中删除该文件.
是否可以将文件保留在我的远程仓库中,并停止跟踪本地更改?
Luc*_*ski 29
使用以下命令:
git update-index --assume-unchanged <filename>
Run Code Online (Sandbox Code Playgroud)
如果您想稍后撤消它,请使用:
git update-index --no-assume-unchanged <filename>
Run Code Online (Sandbox Code Playgroud)