Basic git workflow: committing and pushing

So say you have some work you want to do on the provision module. You first need to clone the repository:

git clone git://git.aegirproject.org/provision

That will create a 'provision' directory with the whole history of the project, and a checkout of the "master" branch (which is the equivalent of CVS's "HEAD" in git).

You make some modifications to the code to fix a bug, and then, you make a commit. That commit will only be local for now, that's the way git works:

vi provision.inc
git commit -m "#12345 fix that pesky bug in provision.inc" provision.inc

Note that contrarily to subversion or CVS, you need to explicitly mention which file(s) you want to commit. You can also use the -a flag to commit all changes.

If you have write access to the repository, you can now push your changes straight into git. However, the git:// url above is readonly, so you will want to use SSH to push your changes. For that, we will have had to add your SSH public key to our repositories. You may also want to add a special "remote" repository to push your changes. You will need to do this only once (per repository):

git remote add aegirproject ssh://gitosis@git.aegirproject.org/provision

You can now push your changes to that repository.

git push aegirproject

If you do not have write access to the repository, you can send the Aegir developers patches by submitting them for review in the Issue queues or by email (use the mailing lists), using git-send-email or git-format-patches.