first look at the commit history and get the commit you want to merge from the main branch, you should see something like this:
$> git log
[...]
commit c5960dbe4674ae72f80cbe1ed5eb0cc690062c7a
Author: (...)
Date: Mon Nov 18 11:42:58 2013 +0100
this is a commit message!
[...]
now switch to your intermediate branch and run
$> git merge <commit-id>
If you haven’t done anything strange, git should be able to speed up fast forward and you're done.
source
share