Skip to content

Instantly share code, notes, and snippets.

@CristinaSolana
Created February 22, 2012 14:56
Show Gist options
  • Save CristinaSolana/1885435 to your computer and use it in GitHub Desktop.
Save CristinaSolana/1885435 to your computer and use it in GitHub Desktop.
Keeping a fork up to date

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
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream

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

git pull upstream master
@uzluisf
Copy link

uzluisf commented Apr 7, 2024

I find it funny that years after years I keep coming back to this gist.

@jef
Copy link

jef commented Apr 8, 2024

I find it funny that years after years I keep coming back to this gist.

Based on this awesome gist, I made a little bash function for myself and use it on a few machines so I don't have to remember 😅

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