Skip to content

Instantly share code, notes, and snippets.

@bilardi
Created November 11, 2019 14:41
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 bilardi/97d4098c2ff21065d2d29c715dcb3812 to your computer and use it in GitHub Desktop.
Save bilardi/97d4098c2ff21065d2d29c715dcb3812 to your computer and use it in GitHub Desktop.
How to update a fork
# Clone your fork
```
$ git clone https://github.com/your-username/your-repository-name.git
```
# Create a remote upstream with the original repository
```
$ cd your-repository-name
$ git remote add upstream git://github.com/original-username/repository-name-forked.git
```
# Update your repository
```
$ cd your-repository-name
$ git fetch upstream
$ git pull upstream master
```
I keep a branch as the original where then I check before the merge. So before the git-pull command, I run git-checkout for updating only that branch.
# Reference
* [configuration](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork)
* [syncing a fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork)
* [pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment