Eric
Eric

Reputation: 19152

Git permanently ignore changeset

I've made a change in my git repository that I don't want to propagate back to anyone else ever. I do want to keep the changes in my local repository. That is, I want pulls to my repo to merge into the changes I've made.

An ideal answer will somehow specify to git that it should permanently ignore a certain changeset whenever I issue a merge command. I'd rather not have to cherry-pick that changeset out every time I merge.

Why?

In case you're curious about the why: I'm using git-tfs. Visual Studio has the unfortunate habit of storing TFS bindings in solution and project files. I'd like to remove those bindings so that VS stops complaining about the bindings being wrong, but if I accidentally check the modified files into TFS, it will break the TFS-VS integration for all the members of my team still using TFS.

How?

Is there an easy way for me to instruct git to always ignore a certain changeset when performing a merge?

Upvotes: 4

Views: 780

Answers (1)

Philip Oakley
Philip Oakley

Reputation: 14071

A quick thought: create a separate local branch on which you have a commit of these special local changes that you are keeping independent. Then when you pull from the external repo, you can then cherry-pick that specific commit onto the commits you've pulled to get to the state you desire - you could even create an alias for it.

You may also want to branch the pulled commits so that you can have both a 'clean' version for pushing and 'your' version for doing work on, and/or you could revert your the commit that contains your specials before you push (along with your normal rebase processes). Obviously you aren't wanting to push any branch which has your local special settings.

Upvotes: 1

Related Questions