sketchpad

A collection of personal and technical notes.

View the Project on GitHub arantebw/sketchpad

How to move a commit from A branch to B branch?

Go to A branch, list all of the commits, then copy the hash of the commit that you need to move to B branch.

sample-repo git:(A) 
➜ git log --oneline
bb35b82 (HEAD -> main, origin/main, origin/HEAD) commit 1
a99d76e commit 2

Go to B branch, then cherry-pick the commit.

sample-repo git:(A)
➜ git switch B
sample-repo git:(B)
➜ git cherry-pick a99d76e