git - Does Github have a way to synchronize your fork with cloned repo? -


does github offer way synchronize fork of github repo changes in source repo?

for instance fork repo, , rename master upstream want keep synchronized changes source repo, can github synchronize upstream master of source repo regularly?

no, github not provide it. instead can achieve locally.

first, create local repository, add own remote , retrieve it.

git init git remote add origin git@github.com:<username>/<repo>.git git pull origin master 

next step, add remote branch repository points original repo forked from.

git remote add --track master <repo-name> git://github.com/<username>/<source-repo>.git 

note master branch want track in forked repo. <repo-name> you. if want verify, run git remote , must see <repo-name> , origin output.

now, ready new changes original repo.

git fetch <repo-name> 

a new branch called <repo-name>/master created latest changes.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

ios - Possible to get UIButton sizeThatFits to work? -