+4 votes
1 view
in Devops and Agile by (20.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 (34.2k points)

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

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