Instruct GIT not to track a specific file

In scenarios like you have a configuration file in  a remote repo for the production environment, and you don’t want to commit the changes to this configuration file made from local. 

How do you instruct git to do not track the local changes?

--skip-worktree is what you need.

git update-index --skip-worktree <filepath/file_name>

After index update git won't show you the file in working tree.


If you want to track the changes update-index as 

git update-index --no-skip-worktree <filepath/file_name>

Comments

Popular posts from this blog

Generate ArcGIS Token By URL Request From ArcGIS Portal, Federated Environment , ESRI JS API and Angular snippets

Update WPF Interaction Triggers in from .Net Framework 4.8 to .Net 5

Solution: IntelliJ not recognizing a particular file correctly, instead its stuck as a text file