1

I have a config file for our debug output system that contains a bunch of example lines. I want all of the engineers to get the basic version of this file when they clone the repo.

I don't want to commit my changes to this file. I want to ignore my changes, but leave the file in the repo for everybody else.

How do I do this? If I git ignore the file then git wants me to commit my changes to .gitignore to the repo. Changing my ~/.gitignore seems to have no effect - the changes still show up in SourceTree.

BTW, I did search around and find this thread. But it doesn't seem to do what I am looking for. How to stop tracking and ignore changes to a file in Git?

Community
  • 1
  • 1
ohthepain
  • 1,679
  • 3
  • 16
  • 25
  • `git reset --hard HEAD` ??? – Jeyaram Jun 20 '14 at 04:39
  • Consider using a global config that they can modify locally. Here's a so post that may help: http://stackoverflow.com/questions/2114111/where-does-git-config-global-get-written-to – Rachael Jun 20 '14 at 04:43

1 Answers1

0

If you update your index (git update-index) in order to instruct git that this file "hasn't changed", then your local modifications won't have to be committed:

git update-index --assume-unchanged -- yourFile

This is a local solution though: anyone else can still modify and commit changes for that same file.

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283