Code Collaboration§

This section describes the use of Git and Github in relation to standard Tudat developer use cases. This chapter does not serve as a complete tutorial on Git, but rather as an extension to the workflow used by Tudat Space.

Mission Brief

Audience

Prerequisite(s)

Time

Git Beginner

git - the simple guide

~ 10 minutes

Note

Using Conda? Git comes with the Anaconda and Miniconda distributions by default. If you are using Conda, the setup step can be skipped in the guide.

Learning Objective(s)

  1. Understand the differences between Git and Github.

  2. Installing and configuring Git for use.

  3. Create, clone and manage repositories from Github.

  4. Understand the Tudat Git workflow.

Note

Tired of retyping your Git credentials in the Command-line?

Attention

This method saves the credentials in plaintext on your PC’s disk. Everyone on your computer can access it, e.g. malicious NPM modules.

Run

git config --global credential.helper store

then

git pull

provide a username and password and those details will then be remembered later. The credentials are stored in a file on the disk, with the disk permissions of “just user readable/writable” but still in plaintext.

Develop and Master Branches§

Instead of a single master branch, this workflow uses two branches to record the history of the project. The master branch stores the official release history, and the develop branch serves as an integration branch for features. It’s also convenient to tag all commits in the master branch with a version number. [2]

Feature Branches§

Each new feature should reside in its own branch, which can be pushed to the central repository for backup/collaboration. But, instead of branching off of master, feature branches use develop as their parent branch. When a feature is complete, it gets merged back into develop. Features should never interact directly with master. [2]