How to update a fork on Github to upstream version without pumping everything though my local computer?

Supposing I:

  1. Forked a 100 MB repository;
  2. Added just one little commit to it;
  3. After month, the upstream repositlry got a lot of commits and now 200 MB;
  4. Now I want to update my forked repository.

I see two ways of doing it:

  • How to have Git show a file's version history
  • How can I squash commits without tracking a remote branch?
  • Can I use git pull --rebase instead of “git stash git pull git stash pop”?
  • What does “@@ -1 +1 @@” mean in Git's diff output?
  • Comparing the pros and cons of Bitbucket to Github
  • git pull --rebase --preserve-merges
    1. Just push the updated version like usual. Drawback: it uploads 100 MB to network. Inefficient.
    2. Delete the forked repository entirely and re-fork it, then upload the changes. Drawback: hassle to set up things.

    How to do it efficiently?

  • How to find what branch the current branch tracks
  • Why Git use 2 different commands to show HEAD?
  • git: rewrite history: reorder and merge commits
  • Find tags in which a commit appears
  • Squash feature branch commit after merging from master
  • Maintain branches in GIT without merging with master
  • One Solution collect form web for “How to update a fork on Github to upstream version without pumping everything though my local computer?”

    Despite I’m yet to see a repository that grows that fast1 I’ll try to answer:

    1. Method two will have a much larger impact on network as you’ll have to reclone the entire repository.
    2. There was similar question a few days before: It is possible to do a merge via GitHubs Web interface by creating a reverse pull request, but this will create additional merge commits and you still have to download those 100 MB.
    3. In case you have access to a server via a greater bandwidth: Perform the update on that machine, it will go faster, but you still have to download those 100 MB.

    In short: Simply go for your first point, it is the most straight forward one.

    1 My last clone of the entire history of the linux kernel is sized 900 MB.

    Git Baby is a git and github fan, let's start git clone.