4. Using GitHub

The tRIBS source code is stored on GitHub using the version control system Git. As a result, any effort to develop, fix, or modify tRIBS source code requires understanding of these tools. While there are a number of useful resources that describe these tools, below we outline the steps that we request all tRIBS developers and users adhere to:

  1. Start by creating a fork of the tRIBS repository.

  2. Create a development branch to add any changes in the source code.

  3. Keep your main and development branch up to date with changes from the main tRIBS repository.

  4. Update the main tRIBS source code from your local fork by creating pull requests on GitHub.

In summary, this means that, any modification or fixes of the tRIBS source code should take place in your own fork of the main tRIBS repository. A fork is a mirror of the repository and is hosted on your personal GitHub account. Any updates, modifications, or fixes to the tRIBS source code can be implemented on this fork. These updates then can be merged to the tRIBS main repository through implementing a pull request on the GitHub website.

Note, if you do not already have a GitHub account you will need to create one, likewise you may need to install Git on your computer. You can create a GitHub account or follow the guide for installing Git. Alternatively, you can use a graphical user interface such as the GitHub Desktop application. If you use Git through the command line, you will need to configure write access using an SSH key, with instructions available in the GitHub SSH documentation.

4.1. Forking tRIBS

The following steps will create a fork of the tRIBS repository under your GitHub account.

  1. Sign in to your GitHub account.

  2. Go to the tRIBS home page on GitHub.

  3. Click the fork button in the upper-right corner of the page.

Once completed, you will be redirected to the home page for your own copy of tRIBS.

4.2. Cloning your fork to your computer

You can clone the fork (that lives on the GitHub website) locally to your computer either using the GitHub app (the GUI), or directly from the command line using git. If you’ve never used Git before, the app is probably the way to go.

4.2.1. Using the GUI/app

  1. Sign in to GitHub on the GUI.

  2. Click on your account on the left side of the GUI.

  3. This will show your fork of tRIBS. Click on the clone option next to the fork which will initiate the download of tRIBS to your computer.

4.2.2. Using the command line

Use the following commands from the terminal.

$ git clone git@github.com:your-user-name/tRIBS.git
$ cd tRIBS
$ git remote add upstream git@github.com:tRIBS-Model/tRIBS.git

Note if you are running into the following errors,

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

then you will likely need to generate a new ssh key and add it to your GitHub profile.

4.2.3. Working with branches

For tRIBS we maintain a main and dev branch. The dev branch is intended to be used for development, hot-fixes, and testing. Consequently, the dev branch may not be functional or fully tested. When you submit a pull request, it can either be on dev branch or a new branch that we will merge with source code after test and evaluating the proposed modifications.