Skip to content

Triangular Workflow

Alexander Zhukov edited this page Nov 3, 2017 · 15 revisions

This workflow is an adaptation of GitHub triangular workflow.

Getting the latest version of core on your local computer

  1. 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.

  2. 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.git
Now you have a clone of origin on your local computer in py-orbit directory
  1. 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 -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.

  1. 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
  1. Update and initialize submodules

    Submodules are separate git repositories that are embedded in your repository.

git submodule deinit .
git submodule update --init

Now you have pyORBIT checked out in pyORBIT sub-directory inside your btf-linac.

  1. Synchronize your local repository with origin

Clone this wiki locally