Updating Your Forked Repository on GitHub

Raj Kumar Maurya
Jul 28, 2017 · 2 min read
Source-Github

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.git

2. 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 master

4. Finally, push your local changes to your forked repository:

git push origin master

Enjoy your fork is updated now…!!!

Source-Pinterest

Raj Kumar Maurya

Written by

Night owl | Adventurous | Stargazing | Traveler | FOSS Enthusiast | Let’s share ideas…!!! | https://rajkmaurya.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade