Skip to content

Getting Started with NIDM

Camille Maumet edited this page Jul 16, 2014 · 1 revision

Collaborating with GitHub

The NIDASH Data Model Working Group uses GitHub to coordinate the development of specifications that define aspects of data sharing and derived data using provenance information. Git can be a little challenging at first, but it is worth learning because of the many benefits it provides.

This tutorial simply documents a few common things you will want to do to keep your repository up to date.

Forking the NIDM Repository

In order to contribute to NIDM, first "fork" a copy of the repository into your own account. Any work that you do will be on your own personal copy of the repository. Any changes you want to contribute can be submitted in the form of a Pull Request.

To fork NIDM, visit https://github.com/incf-nidash/nidm and login. Then click the "Fork" button in the top right of the Github webpage. GitHub will show you a brief animation while this process takes place before you are redirected to your personal copy of the repository.

Cloning the Forked Repository

To get started with a copy of the NIDM repository you will want to create a clone, which creates a local version of the repository on your computer. In a terminal window with git installed, run:

git clone https://github.com/<your-github-username>/nidm.git

You can now cd into the nidm directory and browse the available code.

Adding the "Upstream" Repository

Now that you have a copy of NIDM in your Github account and a local copy, you are going to want to keep this repository up to date. To do this, you will want to fetch and merge changes from the main NIDM repository. To do this, you'll need to add a pointer to what is generally referred to as the upstream repository:

git remote add https://github.com/incf-nidash/nidm.git

Pulling in Changes

Once you have added the remote repository you can pull in changes using the following two commands:

git fetch upstream
git merge master upstream/master

Note: you can also use the simpler git pull upstream that will run these two steps automatically, but running them explicitly makes it more clear exactly what is happening without too much magic.

Committing a Change

After changing the contents of a file you may want to commit those changes to your local repository and then push those changes to your Github repository. Once your changes are reflected in your Github repository you can submit a pull request that informs the NIDM developers that you would like to make a contribution.

First you need to make sure that the file you want to commit is being tracked by git by running:

git add <name-of-file>

Next you will want to commit this file to your local repository. When you commit your changes you must also provide a message about the changes you have made using the -m option

git commit <name-of-file> -m "add: this is my new file"

Pushing Changes to Github

To push your newly created file or modifications of an existing file to Github, you can use the following:

git push origin master

Making a Pull Request

You can submit a pull request through the user Github interface using the instructions found at: https://help.github.com/articles/using-pull-requests#initiating-the-pull-request