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](../../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](../../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:
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 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.

  1. Synchronize local repository with 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 checkout upmaster
git fetch upstream
git diff --name-only usptream/upmaster

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.

  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