Skip to content

Instantly share code, notes, and snippets.

@sihorton
Last active September 6, 2017 10:15
Show Gist options
  • Select an option

  • Save sihorton/866e4943d6835539754189a348129ff6 to your computer and use it in GitHub Desktop.

Select an option

Save sihorton/866e4943d6835539754189a348129ff6 to your computer and use it in GitHub Desktop.
Adding Upstream to a github fork

1. In github for example fork the original repository

2. Clone the repository locally

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

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

cd into/cloned/fork-repo
git remote add upstream https://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
//TortioseGit->Settings
// Git->Remote
// Edit Origin to be Upstream
// Edit URL to be https://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git

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

git pull upstream master
//TortioseGit->Pull, change Remote to be Upstream and OK
//TortioseGit->Push, to send updated repo in line with upstream to forked github repo.

5. Git commit and push works as normal

6. On github then click the create pull request.

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