Wednesday 24 October 2018

git ignore .gitignore file


In one of my project some of my changes in files should not be pushed to git.
In such case i came to know the command which does this

git update-index --assume-unchanged [(Files)]

For example i dont want push .gitignore file changes i did in my local . so command is

git update-index --assume-unchanged .gitignore


--assume-unchanged
--no-assume-unchanged
When these flags are specified, the object names recorded for the paths are not updated. Instead, these options set and unset the “assume unchanged” bit for the paths.
When the “assume unchanged” bit is on, git stops checking the working tree files for possible modifications, so you need to manually unset the bit to tell git when you change the working tree file. This is sometimes helpful when working with a big project on a filesystem that has very slow lstat(2) system call (e.g. cifs).