-
Notifications
You must be signed in to change notification settings - Fork 355
Keeping your fork in sync
Douglas Jacobsen edited this page Jun 25, 2013
·
3 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.
- Clone your fork (follow this)
git clone [email protected]:username/fork.git
- Add a "remote" which points to the MPAS-Dev repository:
git remote add MPAS-Dev [email protected]:MPAS-Dev/MPAS.git
- Create a local branch to house the history of develop:
git checkout --no-track -b develop origin/develop
(Might be done multiple times if you delete your local copy of develop).
- Make sure you're on your local develop branch:
git checkout develop
- Fetch "MPAS-Dev's" history:
git fetch MPAS-Dev
- Merge MPAS-Dev's version of develop into your local version of develop:
git merge MPAS-Dev/develop
- "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
syncs the master branch instead. Other branch names can also be substituted.