-
Notifications
You must be signed in to change notification settings - Fork 38
Triangular Workflow
This workflow is an adaptation of GitHub triangular workflow.
Press Fork button in Py-ORBIT. Now you have your own copy (fork or clone) of Py-ORBIT repository. This repository is called origin in this guide. The main Py-ORBIT repository is called upstream. So origin is a clone of upstream.
In a terminal session on your local computer run following:
git clone https://github.com/<your-GH-username>/py-orbit.git
Now you have a clone of origin on your local computer in py-orbit directory.
You need a way to get modifications that happened upstream, i.e. made by other people.
cd py-orbit
git remote add upstream https://github.com/PyORBIT-Collaboration/py-orbit.git
git remote -v
You should see that you got a new remote called upstream. Now you need a local branch that will track the upstream master.
git fetch upstream
git branch --track upmaster upstream/master
git branch
Now your upmaster branch tracks upstream/master.
git checkout -b new-feature
Modify code, create more branches as needed etc. When you are done with your development and ready to share make sure that all changes are in your feature branch new-feature.
You need to check if someone updated upstream while you were developing your new feature.
git checkout upmaster
git fetch upstream
git diff --name-only usptream/master
Will give a list of files that are different in upstream. Merge them in your local repository in branch upmaster (if the list is not empty).
git merge upstream/master
Now your upmaster branch in your local repository has all modifications from upstream. Your local copy has at least three branches:
- upmaster reflects the most recent state of upstream
- new-feature contains your modifications made while developing the new feature.
- master is common ascendant of upmaster and new-feature, it reflects the state of the upstream at the moment you of your fork synchronization with upstream (or when you forked).
While you were developing new feature others probably changed the code as well. So you need to merge your new-feature and upmaster and ensure that the code is still in working condition.
git checkout new-feature
git merge upmaster
Fix possible conflicts and test the code.
... to be continued ...