How do I and/or is it possible to update (pull
/rebase
/reset --hard branchname
) a fork of a project on github ON THE WEBSITE .. WITHOUT GIT
Here's the specific problem. I just pulled the upstream changes to my local machine over a very slow internet connection (400meg of changes). It took a long time. I'd like to now start making changes locally and then upload my changes to my fork on github. The problem is, when I go to push to github git is going to upload those 400mb of changes to my fork. If I could go to github.com and tell the fork there to update from the place it forked then those 400meg would get transferred on github and when I finally went to push my local changes there'd only be a few k difference to upload.
A diagram. This is the normal way to do this
github:upstream github:origin
\ ↗
\ /
\ /
↘ /
(git pull 400meg slow) (git push 400meg+1k slow)
\ ↗
\ /
\ /
↘ /
local
This is what I want
github:upstream ----> (pull fast) -> github:origin
\ ↗
\ /
\ /
↘ /
(git pull 400meg slow) (git push 1k fast)
\ ↗
\ /
\ /
\ /
↘ /
local
These steps seem to work (please check the last step).
Go to your fork on github and on the right click "Pull Request"
Click "New Pull Request"
You should see a message "There isn't anything to compare". Click "try switching the base for your comparison".
This will switch the pull from forkedrepo:master ... fork:master
to fork:master ... forked:master
.
Type a description like "Merge" and click "Send Pull Request"
You'll now see a pull request going from the forked repo into your fork. Scroll to the bottom. You should see "This pull request can be automatically merged". Click "Merge Pull Request"
Click "Confirm Merge"
At this point you should have all the new changes in your github repo. In order to get rid of the superfluous merge commit these steps seem to work (or maybe I'm missing something?)
Locally,
$ git pull origin master
$ git reset --hard HEAD~1
$ git push origin master -f
note: I found this technique here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With