8

The master is in the form of

http://github.company.com/ourorg/ourproject.git

I have created a FORK from it by clicking on the Fork button and my FORK looks like this:

http://github.company.com/My_User_Name/ourproject.git

Now my goal and question is how to keep my REMOTE FORK in Sync with REMOTE MASTER that I forked from? BUT I do NOT want to Sync the remote fork in to remote master, I only want to sync remote master with my remote fork

If I run a git remote -v command this is what I have so far:

origin  http://github.company.com/My_User_Name/ourpeoject.git (fetch)
origin  http://github.company.com/My_User_Name/ourpeoject.git (push)
upstream    http://github.company.com/ourorg/ourpeoject.git (fetch)
upstream    http://github.company.com/ourorg/ourpeoject.git (push)
superjos
  • 12,189
  • 6
  • 89
  • 134
  • 1
    possible duplicate of [github, update forked project](http://stackoverflow.com/questions/4936109/github-update-forked-project) –  Jul 19 '13 at 12:05
  • 1
    possible duplicate of [How to update GitHub forked repository?](http://stackoverflow.com/questions/7244321/how-to-update-github-forked-repository). –  Jul 19 '13 at 12:05

1 Answers1

14

Your local repository is a clone of your fork, so that is your origin. You need to pull from your remote repository and push to your fork. Assuming that you are on your master branch locally you can pull any changes from the upstream repository (the one that you forked from)

git pull upstream master

Then once you have resolved any merge issues etc you can push the changes to your fork.

git push origin master

how will you get any changes into your company repository of you only do this? And if you're not going to be making any changes why not just clone your company repository and do away with the fork?

Edit.

If you want to sync all of the remote branches you can do

git remote update

Which will fetch all of the remote branches. Then you can push to your origin.

Rufflewind
  • 8,545
  • 2
  • 35
  • 55
Sam Holder
  • 32,535
  • 13
  • 101
  • 181
  • Ok thanks did that but when I look at the number of branches that is created in my fork version, it shows 60....when I look at the number of branches in the master that I forked from it shows 64...so this is not updating it? right? –  Jun 19 '13 at 20:23
  • 1
    Sorry I misunderstood the question as you said you wanted to keep the remote master in sync, I assumed you meant only the master branch. I'll edit the answer. – Sam Holder Jun 19 '13 at 20:27