Git – The Lesser Known Skip-Worktree

When working on a project, there is almost certainly a stage where you would temporarily want to ignore changes in a file from being committed ( like a config file ). If you are using Git, the usually suggested option is ‘assume-unchanged’ as shown below

The problem with this option is that if you do a ‘git checkout .’ ( discarding changes in working tree ) then it will remove the changes in the file you have temporarily ignored also. A better solution is to use the ‘skip-worktree’ option

To remove this use

Tips:

more info at – http://stackoverflow.com/questions/2363197/can-i-get-a-list-of-files-marked-assume-unchanged

more info at – http://stackoverflow.com/a/13568480/206292

 

Leave a Reply

Your email address will not be published. Required fields are marked *