0

I have a GIT repo. Most the files ill work on in a normal way. However a few files I need to change locally but I dont want to ever push these changes to the repo, they are for my local set up only. How can I do this?

Evanss
  • 23,390
  • 94
  • 282
  • 505
  • A common solution is also to have e.g. `config.example.ini` as a tracked file in the repository, and the user (or you in this case) is expected to copy that to just `config.ini` to apply the configuration locally. – poke Jan 22 '14 at 12:01
  • That wont work for me as the "config.ini" is already in the repo and I cant change its filename. – Evanss Jan 22 '14 at 12:09
  • had a similar problem (http://stackoverflow.com/questions/12968865/how-to-set-a-vsprops-variable-only-if-it-does-not-already-exist) and ended up using filters. Once you've got the hang, they're pretty cool! – eckes Jan 22 '14 at 13:41

2 Answers2

2

You can use git update-index, in this form:

git update-index --assume-unchanged my.properties

Git will then no longer check the working copy for changes to my.properties. To re-commence tracking of changes to this file, perform the reverse:

git update-index --no-assume-unchanged my.properties

More detail in the official documentation.

Cam Smith
  • 121
  • 1
1

You can:

$ git update-index --assume-unchanged <filename>

To temporarily ignore changes. https://www.kernel.org/pub/software/scm/git/docs/git-update-index.html#_using_8220_assume_unchanged_8221_bit

jshawl
  • 3,315
  • 2
  • 22
  • 34