Take the 2-minute tour ×

First of all, I am new to using 'git'. And I am using SourceTree client.

I have the following scenario. I have checked out the code from git repository. I have made few changes to the code. In the mean time, a new branch (say "vv1") was created in the repository. Now I wanted to commit my changes to both master and vv1. Can anybody guide me regarding this, with the help of SourceTree?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Commit to one of the branches, then you've got a choice:

  • If the branches haven't diverged, merge said branch into the other. This will perform a fast-forward.
  • If the branches have diverged, you can cherry-pick the commit into the other branch.

A larger question is why are you trying to commit to two seperate branches rather than letting the author of vv1 finish the feature and when merging back in, resolve the concern?

share|improve this answer
It might make sense to merge master into the feature branch even if the branches diverged already. –  svick May 4 '12 at 6:56
Thanks robrich.. –  Aadhira May 4 '12 at 7:10

Your Answer


