Untrack Local Files in Git

Sometimes we require to untrack files or folders that have already been added to a git repository. The following git command will stop tracking specified files or folders but keep the file in a git repository intact. This is good for files or directories that have auto generated files or need to be customized often (e.g configuration files). So everytime you do a git commit, you don’t have to commit a new copy of these (modified) files.

git rm --cached filename

replace filename to your preferred file name to be untracked on git.

Leave a Reply

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




You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>