DEV Community

Copy commit from one branch to another without using git merge

Fongoh Martin T. on November 20, 2020

So I was doing some tests in code today and had to create a test branch. After the testing was done, I forgot to change the branch back to "master...
Collapse
 
tfrick47 profile image
Terri Fricker

Thanks! Just what I needed this morning.

Collapse
 
bosz profile image
Fongoh Martin T.

Happy it solved your problem.

Collapse
 
karan_s_mittal profile image
Karan Mittal

you are a life saver. Thanks

Collapse
 
bosz profile image
Fongoh Martin T.

Glad the post could help.

Collapse
 
pavel256 profile image
pavel-256

It works like a magic !!!
thanks

Collapse
 
bosz profile image
Fongoh Martin T.

Happy could help.

Collapse
 
patrick_meppe_2e406b0871d profile image
Patrick Meppe

This is exactly what I was looking for. 😀
In my case I am building a CI/CD process and need to integrate the changes made after the build processes (build branch) in the main-dev branch.

Thanks and Greetings.

Collapse
 
esambe profile image
esambe

Great. Maybe cherry-pick command is used behind the scene somehow to manage merging.😁

Collapse
 
bosz profile image
Fongoh Martin T.

Thanks man. Yea, could be, not yet explored git that much...

Collapse
 
anmolchh500 profile image
Anmol Chhabra

It gave me an warning after I tried to pull from main:
You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).
Please, commit your changes before you merge.

Collapse
 
syedsuhaib profile image
Suhaib H Syed

I signed up at dev.to just to say thanks to you. Thank you for explaining the cherry-pick command in just the right context.