Git: How to make a file not to be tracked in future commits?

As a developer, you may come across scenarios when you think that certain SPECIAL files should not be tracked in Git commits.

As the first step, commit all changes in your repository and then add those SPECIAL files to .gitignore

To remove a file (not delete) from getting tracked in your Git repository use:

$ git rm –cached sampleconfig.txt

To remove all files that is referenced in your .gitignore use:

$ git rm -r –cached .

After this step, commit your changes to git and you will no longer see those SPECIAL files in your future commits.

$ git add .

$ git commit -am “Cleaning files based on .gitignore”

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Written by kurinchilamp


Website: http://

Leave a Reply

Your email address will not be published. Required fields are marked *

Kurinchi Calendar
October 2017
M T W T F S S
« Jul    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
Read previous post:
How to run multiple node versions in a computer?

Solution is to use Node Version Manager (nvm) which helps manage multiple version of node versions. $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh...

Close