Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

update github fork from web only (in other words WITHOUT GIT!)

Tags:

github

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
like image 636
gman Avatar asked Mar 11 '14 06:03

gman


1 Answers

These steps seem to work (please check the last step).

  1. Go to your fork on github and on the right click "Pull Request"

  2. Click "New Pull Request"

  3. 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.

  4. Type a description like "Merge" and click "Send Pull Request"

  5. 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"

  6. 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.

like image 135
gman Avatar answered Nov 13 '22 16:11

gman