Explore Courses Blog Tutorials Interview Questions
+4 votes
in DevOps and Agile by (29.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

+5 votes
by (50.2k points)
edited 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:

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

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

Browse Categories