0

I have a settings file that contains some settings that are environment/machine/developer specific and some settings that are globally applicable. When I change the stuff that is developer specific, I don't want those changes to show up in git, but I do want the stuff that is global to be committed.

So, I'm looking for something like

git update-index --assume-unchanged <file>

where I can ignore a specific changeset, but... when I edit the file again, git will see the new changes but not the ignored ones.

Does this make sense?

Mr Mikkél
  • 2,577
  • 4
  • 34
  • 52

1 Answers1

1

Because Git is snapshot based at its core, you can't ignore a changeset (difference of snapshots) within a commit sequence.

There are a few approaches to keeping such a changeset independent, mainly by having an independent branch and continuously rebasing those extras.

Philip Oakley
  • 13,333
  • 9
  • 48
  • 71
  • Google suggests trying http://stackoverflow.com/questions/999064/how-to-keep-public-and-private-versions-of-a-git-repo-in-sync. In addition you can use `git rebase --interactive` to keep bring your private branch forward every time you fetch/pull in the main branch development. Or `git cherry-pick` if it is a single squashed commit with your private bits. There is also a 'merging rebase' script in the msysgit tree commit 9424c7c which attempts to keep the msysgit 'tweaks' on top of git.git as each release rolls by. – Philip Oakley Aug 02 '13 at 21:03
  • Thank you. I appreciate the explanation. – Mr Mikkél Aug 02 '13 at 22:53