Created
January 17, 2023 06:42
-
-
Save jandrodev/fba3bea5a2a19774c0a8d1f5d8be618e to your computer and use it in GitHub Desktop.
Git - Move last pushed commit from branch a to branch b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Move last pushed commit from branch a to branch b | |
git checkout b | |
git cherry-pick $commitHash | |
git push origin b | |
git checkout a | |
git rebase -i HEAD~1 | |
git push -f origin a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment