12

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 Which I should have did

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 1 commit f2c88ca into my branchA as well ?

Any hints on this will be much appreciated !

code-8
  • 49,286
  • 91
  • 294
  • 502

1 Answers1

29

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,749
  • 1
  • 21
  • 40