Keeping a fork up to date

To sync changes you make in a fork with the original repository, you must configure a remote that points to the upstream repository in Git.

Specify a new remote upstream repository that will be synced with the fork.

git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git

You can check if it was succesful with:

git remote -v

Then fetch it to update your project:

git fetch upstream

Merge the changes from upstream/master into your local master branch.

git merge upstream/master

At last, you can commit new update from original repository to your fork repository.

Shortcut: you can also combine the last two commands into a single command:

git fetch upstream
git merge upstream/master

Is equal to:

git pull upstream/master

This information can also be found on GitHub here and here.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)