Skip to content

Development Workflow

ramirezfranciscof edited this page Jan 26, 2017 · 53 revisions

The main repository of LIO (this one) will permanently maintain the two basic branches of the code: master and develop. We have master as the placeholder for the latest official release of the code, whereas develop is where new features are continually incorporated. This repository might eventually also host some release or hotfix branches, but these should be transitory.

If you want to contribute to our code, the first step is creating a github account (sign up here) and forking this repository (click "Fork" on the upper right corner of this page). The following sections contain basic descriptions on the 4 most important processes you will need to perform. Further knowledge on how git and github work is encouraged, but this should suffice for your first steps.


## Cloning your repository

When you clone your repository, you make a local copy in your computer of all the information on your remote repository. This local copy is "linked" to the repository hosted in github so as to let you easily update changes in one or the other. This way you can not only keep those two synced, but also all your cloned copies in all your workstations.

The process of cloning a repository is described in the main page of this Wiki, and you could adapt that for your forked version and use it as it is. Here we will first describe how to set up a clone by using the ssh protocol instead of the https, because the first one is usually more secure and comfortable for development (to reconfigure a clone from https to ssh, check this link). If you wish to keep using https, feel free to skip this part except for the third step of setting up the upstream remote (adapted for https).

For more information on github protocols, you can check out this link.

  1. You will first need and ssh keypair. You can check your keypairs by running ls -al ~/.ssh: they have the form id_blabla and id_blabla.pub (the private-key and public-key respectively). If you don't have one or you want to create a new one for this clone, you can do so by running:
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

You can accept the default location, but it is advisable to not leave the passphrase empty.

  1. Then you need to add your private-key to your ssh agent (ssh-add ~/.ssh/id_rsa) and then add your public-key to your github account (you can follow the instructions here). Now you are ready to clone your repository:
$ git clone git@github.com:user_name/repo_name.git local_repo

This will set up a local_repo folder in your current location and download there all the content of your forked repository (user_name and repo_name should be changed with your user and fork's information).

  1. Finally we will set up a special remote that points to the original repository. You won't be able to push here, but I will be useful for pulling data. If you want to know more about remotes you can check out this link. For now, you simply need to run the following command:
$ git remote add upstream git@github.com:nanolebrero/lio

## Working in Branches

As a general rule of thumb you should never modify master or develop directly. You should always create new branches, make your modifications there, and then merge them back into develop (which will eventually be merged into master).

To create a new branch to work in, you should do so branching off develop by running any of these two set of commands (two are included for illustrative purposes):

$ git branch branch_name develop
$ git checkout branch_name #switch to new branch
$ git checkout -b branch_name develop

The first will automatically switch you to that branch And now you should switch to that branch (git checkout branch_name)

to develop using >$ git checkout develop. Create a new branch by running >$ git checkout -b newbranch and push it to your online repository with git push -u origin newbranch. Now you can work here, commit changes and push them to you forked repository as you please.


## Updating Changes
## Sending your work

Clone this wiki locally