Syncing remote fork with remote master

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)

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.

链接地址: http://www.djcxy.com/p/18080.html

上一篇: 首选Github工作流程,用于在代码审查后更新拉取请求

下一篇: 将远程叉与远程主盘同步