Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Keeping your fork in sync

Doug Jacobsen edited this page Feb 4, 2015 · 6 revisions

How to keep your fork's branches in sync with https://github.com/MPAS-Dev/MPAS.

Because a fork is created as a snapshot of another repository, the branches in the fork don't auto-update with the original repository. The syncing of branches between repositories must be done manually through the use of your local clone.

There are two parts to this. The first part only has to be done once per local repository.

One time setup:

  1. Clone your fork (follow this) git clone git@github.com:username/fork.git
  2. Add a "remote" which points to the MPAS-Dev repository: git remote add MPAS-Dev git@github.com:MPAS-Dev/MPAS.git
  3. Create a local branch to house the history of develop: git checkout -b develop origin/develop (Might be done multiple times if you delete your local copy of develop).

Every time you want to update:

  1. Make sure you're on your local develop branch: git checkout develop
  2. Fetch "MPAS-Dev's" history: git fetch MPAS-Dev
  3. Merge MPAS-Dev's version of develop into your local version of develop: git merge MPAS-Dev/develop
  4. "Push" your local version of develop onto your fork: git push origin develop

The above example uses develop as the branch to sync. Replacing develop with master or core/develop syncs a different branch instead.

Clone this wiki locally