Git insert a cherry-pick
2021-06-08 本文已影响0人
JaedenKil
Say I have commits A - B - C
, "C" is the newest commit.
I need to run cherry-pick
a "X" commit, and insert the commit between "B" & "C".
- Rebase
git rebase -i hashValueForA
- Edit
In the pop-up message, change "pick" to "e" for "B". - Cherry-pick
git cherry-pick hashValueForX
- Rebase
git rebase --continue
- Push
git push -f // If needed, and be careful about this step