-
Notifications
You must be signed in to change notification settings - Fork 39
Triangular Workflow
This workflow is an adaptation of GitHub triangular workflow.
-
Create a fork of Py-ORBIT.
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.
-
Clone your repository to your local computer
In a terminal session on your local computer run following (put your username in place of XXX)
git clone https://github.com/<your-GH-username>/py-orbit.gitNow you have a clone of origin on your local computer in py-orbit directory
-
Setup upstream
You need a way to get modifications that happened upstream, i.e. made by other people.
cd py-orbit
git remote add upstream [email protected]:pyORBIT/btf-linac.git
git remote -vYou 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 branchNow your upmaster branch tracks upstream/master.
-
Merge any changes that happened upstream.
There should be no changes if you are doing the whole guide from the beginning and your fork is fresh. But if you made fork some time before your fork can be outdated.
git diff --name-only Will give a list of files that are different in upstream. Merge them in your local master (if the list is not empty).
git checkout master
git merge upmaster-
Update and initialize submodules
Submodules are separate git repositories that are embedded in your repository.
git submodule deinit .
git submodule update --initNow you have pyORBIT checked out in pyORBIT sub-directory inside your btf-linac.
- Synchronize your local repository with origin