- 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
# 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)
$ git fetch upstream # merge upstream into my forked repo's master branch $ git merge upstream/master
$ git push origin master
If you added a wrong url, you would need to remove it with the following command.
$ git remote rm upstream