Skip to content

How-to

Below you will find details instructions on how to follow various steps of the contribution guidelines with GitHub and git.

Cloning a repository

On CABLE's GitHub main page, click the code green button, choose the SSH protocol and copy the URL you need:

how_clone

On your local machine in a terminal, clone the repository:

git clone <URL provided>

Change the protocol after cloning

It is possible to change the access protocol to GitHub in your cloned repository if you realise you have chosen the wrong protocol, ie.:

  • you have cloned using the HTTPS protocol but have SSH keys setup with GitHub
  • or you have cloned using the SSH protocol but you have a personal access token setup with GitHub

To do this, follow the steps:

  1. Remove the current remote repository
    git remote rm origin
    
  2. Add the new remote repository
    git remote add origin <URL>
    
  3. Reset the connection between your local and remote branches (this can be done at any time). Do this for your current branch and main at least. Checkout each branch you want to reset and type:
    git branch -u origin/<branch_name>
    

Assign an issue

When starting work on an issue, on that issue page on GitHub, assign yourself to that issue following the steps in the image:

how assign

Create a branch

Since we want to enforce a branch naming convention for CABLE, the simplest is to create the branch on the GitHub repository and then get that branch on your local repository.

  1. Create the branch on GitHub:

    how branch

  2. Keep all options to default on the confirmation pop-up window:

    how confirm branch

  3. Get the branch locally. Copy the commands given by GitHub and paste them in your terminal within your local repository.

    how local branch

Create a pull request (PR)

Once you push at least one commit to a new branch, you can create a pull request with the following steps:

  1. Click New pull request:

    how start pr

  2. Check the branches are correct and continue

    how check branches pr

  3. Fill the description as best you can. The CABLE pull requests will come with a template to guide you through the information needed. The description and the title are editable at any time. It is often impossible to give the whole description at the start of the PR.

    how describe pr