Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose that I have several shared branches on my Git repository, for example: newfeature, experiment and gtkgui, and I share those branches in the origin repository. My team and I make some changes on all branches and push those changes into the origin repository. Later I detect a minor bug on the core code, I fix it and commit it to the master branch.

I need this fix to be available on the other three branches. What is the best way to do this? Do I need to merge the master branch into the other branches one by one and push them? Could git rebase help me?

share|improve this question

The two solutions are topic branch and cherry-picking:
See "Git & Working on multiple branches".

Now I really don't recommend cherry-picking, which in your case would mean duplicating a set of commits all over the place (i.e. in different branches).

So as long as you make changes from the oldest branch that needs them, and merge forward, you are on the right track.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.