Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I created an account at https://github.com/, fork someone's project so I have my own repository, instal github client for windows, and clone my repository to my local drive.

I will work on my local drive. But during the developement of the project, I would like to merge the changes in the official, original, project.

I didn't find how to do this. Before, I use tortoiseSVN client for windows, and there is an option "SVN Update" which can update the project to the latest revision. But I am new to Github and its client, and don't know how to do it.

share|improve this question
    
which client are you using? –  Sathya Oct 12 '12 at 20:10
    
I download the client here, windows.github.com, I thought it is the official client? –  user565739 Oct 12 '12 at 20:16
    
that it is, but it's pretty limited - are you looking to merge changes to the original project or from the original project? –  Sathya Oct 12 '12 at 20:18
    
merge changes from the original project to my own repository –  user565739 Oct 12 '12 at 20:31

1 Answer 1

up vote 4 down vote accepted

The GitHub for Windows client does not support having multiple remotes[1], which is required in order to sync a forked repo with an upstream repository. You'll have to drop to the command line to perform the update. GitHub has some nice instructions in their documentation which I'll summarize:

Once you have your local repo, add a new "upstream" remote:

git remote add upstream <path to upstream repo>   

Now fetch the upstream repo to get the newest updates (not merged to your local repo yet)

git fetch upstream

Now merge in the upstream changes

git merge upstream/master
share|improve this answer
    
It should be noted it might be feasible to rebase your commits if you didn't push them yet. –  Tom Wijsman Oct 12 '12 at 20:24
    
well, you beat me to it :-) alternatively, a git pull will do the fetch + merge –  Sathya Oct 12 '12 at 20:25
    
so "path to upstream repo" is the original project repository, not my own folked repository? –  user565739 Oct 12 '12 at 20:35
1  
@user62046 That is correct, you'll add a remote reference the original repo and merge changes from there, then you can push the changes you make back to your personal fork on Github. –  heavyd Oct 12 '12 at 20:36
1  
@user62046, that is more of a fundamental git usage question, so I would recommend checking out the git documentation on branching, but to answer your question just change the "master" in the merge command to which ever branch you want to update, so to update "branch_1" run git merge upstream/branch_1 –  heavyd Oct 12 '12 at 21:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.