Skip to content

Instantly share code, notes, and snippets.

@eshaan7
Last active December 3, 2020 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eshaan7/d4157af0e0012ec286bbefe17d01751d to your computer and use it in GitHub Desktop.
Save eshaan7/d4157af0e0012ec286bbefe17d01751d to your computer and use it in GitHub Desktop.
Syncing a forked repo with original repo

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
# Add the remote, call it "upstream":
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:  
git fetch upstream
# Make sure that you're on your master branch
git checkout master

3. Updating your fork from original repo to keep up with their changes:

git pull upstream master

4. Pushing changes from local-repo to remote-repo

git push origin master
@eshaan7
Copy link
Author

eshaan7 commented Jun 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment