#case: you fork a repo from github into your account, and upstream (owner) of repo have an update and you want to sync it to your fork repo
sample:
— you fork my repo: https://github.com/addhe/Akubot then it will copied over to your github account let’s called your github account ‘mrsomething’ Akubot repo will be copy and now it become https://github.com/mrsomething/Akubot.git
— you now able to git clone Akubot thru your github account, you will be able to push, commit and so forth.
— in the future i have update to Akubot and it’s important, you want to update your Akubot and do not want to destroy or remove your custom changes. let’s do this
- cd Akubot
- check upstream, change the upstrem to my repo
“`
git remote add upstream https://github.com/addhe/Akubot.git
“` - check git remote
“`
git remote -v
“` - fetch upstream update
“`
git fetch upstream
“` - Check out to your local master repo, this will change to master branch
“`
git checkout master
“` - Merge Upstream update to your local repo
“`
git merge upstream/master
“`