Commit to multiple branches at the same time

The cherry-pick feature will do the job and will only apply the last commit:

Considering branches A, B

git checkout A
git commit -m "Fixed the bug x"
git checkout B
git cherry-pick A

hope this helps!

Leave a Comment