Created
January 3, 2019 21:26
-
-
Save cb372/66bc0ffdfec87744c473355a34ac61f3 to your computer and use it in GitHub Desktop.
Pushing commits to someone else's PR
This file contains 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
# Terminology | |
their_username = the GitHub username of the contributor who submitted the PR | |
their_branch = the name of the branch they used to submit the PR | |
repo_name = the name of your GitHub repository | |
# First add their fork as a remote | |
git remote add $their_username [email protected]:${their_username}/${repo_name}.git | |
# Then fetch it | |
git fetch $their_username | |
# Checkout the branch they used for the PR | |
git checkout $their_branch | |
# ... Make your changes and commit them ... | |
git commit -m "Minor fixes" | |
# Push to their branch | |
git push -u $their_username $their_branch | |
# You can even do things like rebase their branch against master and force-push. | |
# Probably best to warn the contributor before you do this though! | |
git rebase origin/master | |
git push -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment