Git Repository

We want as many people as possible to take a look at, and contribute to, OpenMAMA, and as such we've decided to host our version control on GitHub.

git is used for a large number of development projects, the most notable being the Linux kernel. There are a number of excellent git tutorials out there, though perhaps the most comprehensive (and authoritative) is the "Git Book"

Basic Tasks in git

Get the OpenMAMA source code

This will create a directory named "openmama" in your home directory, and fetch the most up-to-date version of the source code.
$ git clone https://github.com/OpenMAMA/OpenMAMA.git ~/openmama

Update your local copy of the source code

Use this before you begin any new development, to get the latest updates.
$ cd ~/openmama
$ git pull --rebase https://github.com/OpenMAMA/OpenMAMA.git

Undo any changes you've made

This discards any changes you may have made to files within your local copy of the OpenMAMA source code. Note that it only affects files tracked by git. It won't prune files.
$ cd ~/openmama
$ git checkout -f

Finding your changes

This shows changes to files that are tracked in git since the last time you ran "git add" or "git rm". Note that untracked files will not be listed here.
$ cd ~/openmama
$ git diff
This shows any changes you've made since the last commit.
$ cd ~/openmama
$ git diff HEAD
This gives a brief overview of how the directory differs from the last commit. It will list new files that are untracked, and any changes waiting to be committed.
$ cd ~/openmama
$ git status

Finding out who changed what

This returns the changeset of all commits to the git tree. If something stopped working after your last git pull, this is a good place to look for clues as to what changed.
$ cd ~/openmama
$ git log
You can also look at the changelog for a particular file.
$ cd ~/openmama
$ git log path/to/file
Other useful options for git log include '-p', which shows the diff source code, and '--stat', which gives detailed information on insertions, deletions, and modifications per file. (You may have to install the diffstat package separately.)