Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cb372
Created January 3, 2019 21:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cb372/66bc0ffdfec87744c473355a34ac61f3 to your computer and use it in GitHub Desktop.
Save cb372/66bc0ffdfec87744c473355a34ac61f3 to your computer and use it in GitHub Desktop.
Pushing commits to someone else's PR
# 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 git@github.com:${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