Last active
February 28, 2024 10:57
-
-
Save tomgross/4362329ef99acc54bc774b7b37650911 to your computer and use it in GitHub Desktop.
Recreating a messed up github pull request
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
# if some commits landed erroneous in a PR on github | |
# this commands help to start fresh from master | |
# replace `my_pr_branch` with the name of the branch of your pull request | |
git checkout my_pr_branch | |
git diff master > ../pr.patch | |
git checkout master | |
git branch -D my_pr_branch | |
# make sure it is the *SAME* name than the branch you deleted | |
git checkout -b my_pr_branch | |
patch -p1 < ../pr.patch | |
# git add ... if necessary | |
git commit -a -m "Describe the PR commit" | |
git push -f --set-upstream origin my_pr_branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment