git – skipping specific commits when merging

I’ve been using Git for about a year now and think it’s fantastic, but I’ve just started on a second version of the project and started a new branch for it. I’m struggling a little with the best way to handle things going forward.

I have two branches called say master10 (for v1) and master20 (for v2). I’ve been making bug fixes in v1 on branch master10, and developing new stuff of master20. Whenever I make a bug fix I merge it into v2 by checking out master20 and doing git merge master10. So far so good.

Now however, I’ve made a change in v1 that I don’t want in v2, but I want to continue merging other bug fixes. How do I tell Git to skip that particular commit (or a range of commits), but that going forward I still want to merge other bug fixes.

I thought git rebase might be what I need but read the doc and my head nearly exploded.

I think what I want is something like a “git sync” command that tells git that two branches are now in-sync and in future only merge the commits from this sync-point on.

Any help appreciated.

8 Answers
8

Leave a Comment