14

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 ?

0

1 Answer 1

34

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 
Sign up to request clarification or add additional context in comments.

2 Comments

Excellent! Just to clarify 'f2c88ca' is the actual commit name.
When Git works , it creates magic.. if it doesn't it creates panic..

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.