Original write-up Gist for SSH: https://gist.github.com/CristinaSolana/1885435
git clone https://github.com/$my_username/$repo_name
cd $repo_name
git remote add upstream https://github.com/$origin_fork/$repo_name.git
git fetch upstream
git pull upstream $branch_name
You'll need to fork pandas-dev/pandas if you want to follow along. I'm not associated with them; I just chose a random repo I already had forked from the front-page.
git clone https://github.com/pandas-dev/pandas
cd pandas
git remote add upstream https://github.com/pandas-dev/pandas.git
git fetch upstream
git checkout master
git pull upstream master
git add -A
git commit -m "Sync my pandas master w/ pandas-dev master branch"
git push origin master
- Go to this URL: https://github.com/$my_username/$repo_name/compare/$branch_name...$origin_fork:$branch_name
- Click on "Create pull request"
- Add a title. I'd just call it
upstream sync
, personally - Click on the new "Create pull request" button
- Scroll to the bottom
- Merge the pull request
a. If you want to keep the commit history, just click "Merge pull request", then "Confirm merge"
b. If you just want the code changes and only have a single commit to merge, click on the dropdown for "Merge pull request", select "Squash and Merge", then click on "Confirm Squash and Merge" c. If you want to rebase, have fun with that :) jk! Do pretty much the same thing as 6b but use the Rebase options
- From your fork's repo, click on "New pull request"
- Click on "compare across forks"
- On the left-hand side, select your fork
- Click on "compare across forks" again
- On the right-hand side, select the origin fork
- Follow steps #2 through #6 in the Browser Instructions section above this one
While I can't really give you a "real" example for this beyond a screenshot, here's what I used for Mozilla's DeepSpeech sync to master:
https://github.com/the-nose-knows/DeepSpeech/compare/master...mozilla:master