Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.