Equivalent to “git update-index --assume-unchanged

2020-05-18 12:05发布

So far I used git update-index --assume-unchanged on the database configuration file after I filled in the database password because I don't want my database password to get into the public code repository.

Now I wanted to try and use SourceTree for a while and I can't find a way to do the same with it: The file should remain in the repository but I just want SourceTree to ignore changes to that file in my working copy.

2条回答
Rolldiameter
2楼-- · 2020-05-18 12:52

I just defined custom action for this task.

Make sure the path to git is correct.

Thanks to @RobCroll from the comments, we now have a Windows version:

C:\Program Files (x86)\Git\bin\git.exe (for x64 use: C:\Program Files\Git\bin)
Parameters: update-index --assume-unchanged $FILE 

enter image description here

查看更多
欢心
3楼-- · 2020-05-18 13:03

It is quite likely that SourceTree doesn't have a feature for manipulating the index in that way (although I could be wrong, but it doesn't seem to). However that doesn't mean you can't drop down to the terminal in order to issue that command, but continue to use SourceTree for everything else.

查看更多
登录 后发表回答