+5 votes
1 view
in Devops and Agile by (22.3k points)
edited by

I have setup a local git on my machine. When I initialized git, I added pre-compiled libs and binaries. However, now during my development, I don't want to check in those files intermittently. I don't want to remove these files from repo. Is there any way to not keep a track of these files until I complete my development. (I think I can not use .gitignore as it works only for those files which are not in git. I want to temporarily disable tracking of files.)

1 Answer

+6 votes
by (38.3k points)
edited ago by

To untrack files from git temporarily you need to use:

git update-index --assume-unchanged path/to/file

This command will say git to ignore the changes made to this file.

And to start tracking the file you could use:

git update-index --no-assume-unchanged path/to/file

For more information: https://git-scm.com/docs/git-update-index#Documentation/git-update-index.txt---no-assume-unchanged

For better understanding about these commands go through the following crash course on git that will help you to understand git well

by (22.3k points)
can we untrack the files using .gitignore file?
...