Working With Git

From Avogadro - Free cross-platform molecule editor
Revision as of 12:12, 30 December 2008 by Cryos (talk | contribs)
Jump to: navigation, search

In December 2008 Avogadro moved its version control system over to Git, hosted at GitHub. Git is quite different to traditional, centralized version control systems. It is a DVCS (Distrubuted Version Control System). It was coded by Linus Torvalds and others primarily to handle the Linux kernel's very distributed development model.

There are lots of guides around that help you to work with Git. A good quick start guide is everyday Git. In a normal workflow we recommend that you sign up for a GitHub account, go to the Avogadro GitHub page and fork Avogadro. You will then get your own copy of the Git repository. You can keep this up to date using the web interface or Git, and can make pull requests when your changes are ready for integration.

Configuring Git

The first thing you will want to do is tell Git who you are. This will be used in commit messages and attributions.

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

If you are like me you may also want to add some color to the Git output.

git config --global color.branch true
git config --global color.diff true
git config --global color.interactive true
git config --global color.pager true
git config --global color.status true

One or Two Patches

If you just have one or two patches you would like to submit you probably just want to clone our repository.

git clone [email protected]:cryos/avogadro.git

Make any changes you like, commit them to your local repository and then use git format-patch to make a patch. When the patch is applied it goes into Git just like any other commit and you get full credit. For this reason you should ensure you set up your name and email correctly before committing anything.