🍒 Cherry-pick in github

By | September 28, 2021

I began to use cherry picking to add changes from a commit from one branch and move them onto another branch. Cherry-pick looks promising for transferring the code changes between branches. Everything is simple according to the documentation but a little different in real life. It took me approximately one hour to pick a cherry successfully. Similar hard to get way out as it was before with github. Multiple attempts of git cherry-pick ended with fatal: bad revision. Cherry-pick was refusing to carry over changes from branch xxxxx to branch yyyyy numerous advices from Google to fetch, checkout or rebase did not help.
Finally the solution was found. The branch xxxxx existed in a remote git repository and should be added:

git remote add -f xxxxx git@github.com:ladydebug-dot-com/ladydebug-dot-com.git

After that cherry was picked without problem:

git cherry-pick -n 123abc

🍒 => 🧺

Leave a Reply

Your email address will not be published. Required fields are marked *