Update forked repo with remote repo

Add remote repository

# cd <forked-repo>
# git checkout 
# git remote add upstream <remote-repo-git-link>
#git fetch upstream

Updating fork from remote repo

# git pull upstream 

Example (This is what I did to sync from remote branch and push to forked repo)

# cd <forked-repo>
# git checkout
# git remote add upstream <remote-repo-git-link>
# git fetch upstream
# git pull upstream --rebase

As local repo changes are rebased, faced error while pushing changes to forked repo. Runt these commands to rebase changes for forked branch.

# git pull --rebase
# git push origin <forked-branch>

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s