Updating Your Forked Repository on GitHub
Jul 28, 2017 · 2 min read

Many of the users or people who have just started their journey with GitHub, often fork the interested repository they tend to contribute of just to keep track of it’s development. When someone fork’s a repository then a clone of that original repository is made in the user’s repository.
Whenever someone pushes their code to the original repository then the all forked repositories of that project needs to be updated (all the changes) to get the latest code in parallel as the original repository.
Steps to update your forked repository:
1. Clone your forked repository:
git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPOSITORY.git2. Add remote from original repository in your forked repository:
cd into_your/cloned/fork-repositorygit remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPOSIORY-YOU-FORKED-FROM.gitgit fetch upstream
3. Now, Update your fork from original repository to keep up with their changes:
git pull upstream master4. Finally, push your local changes to your forked repository:
git push origin masterEnjoy your fork is updated now…!!!

