13

I have 2 branches :

  • branchA
  • branchB

I checkout branchB, and fix a small thing while I am on that branch.

commit f2c88cad3d7648cad9c12e724d09db0952abec63
Author: Name <email>
Date:   Fri Mar 18 09:10:22 2016 -0400

    Fix small bug on dashboard 

Then, I do git push origin branchB, but I should have done git push origin branchA branchB.

Now, in branchB I have

commit f2c88cad3d7648cad9c12e724d09db0952abec63

but I don't have it on branchA.

How do I copy that one commit f2c88ca into my branchA as well ?

halfer
  • 19,824
  • 17
  • 99
  • 186
code-8
  • 54,650
  • 106
  • 352
  • 604

1 Answers1

31

You can use git cherry-pick command to copy commit to another branch. In your case, once you checkout branchA then do

git cherry-pick f2c88ca 
Ankit Bansal
  • 4,962
  • 1
  • 23
  • 40