Pre-condition
- you have github account
- you have git on your local machine
- you have a fork repo
- you have cloned the fork repo
In this post, I use https://github.com/memo/eco-nft as the original repo.
My forked repo is https://github.com/koji/eco-nft.git
set original repo
# add remote repo as upstream
$ git remote add upstream https://github.com/original_repo_you_forked
# check info
$ git remote -v
origin https://github.com/koji/eco-nft.git (fetch)
origin https://github.com/koji/eco-nft.git (push)
upstream https://github.com/memo/eco-nft (fetch)
upstream https://github.com/memo/eco-nft (push)
fetch & merge
$ git fetch upstream
# merge upstream into my forked repo's master branch
$ git merge upstream/master
push (to make a forked repo updated)
$ git push origin master
remove upstream from remote
If you added a wrong url, you would need to remove it with the following command.
$ git remote rm upstream