Set Git to stop tracking file

Set Git to stop tracking file

I have found the need to ignore a file with out using the .gitignore. In my case its because of a chrome driver that we using for Cucumber and Watir. The office has a standard setup with a certain repository, however on my Mac chrome likes to update. This causes an issue with versioning of the driver. So I wanted to put a new chromedriver in my repository folder but not ignore it from the repository. To do this little trick I can update the index and tell it to assume the file is unchanged.

git update-index --assume-unchanged <file>

If you have the need to reverse the tracking of the file.

git update-index --no-assume-unchanged <file>