Git: Difference between revisions

From London Hackspace Wiki
(Created page with 'For version control of the IRC bot scripts we use [http://en.wikipedia.org/wiki/Git_%28software%29 git]. To contribute to the scripts accessible via robonaut (the bot), you'll ne…')
(No difference)

Revision as of 15:25, 13 May 2010

For version control of the IRC bot scripts we use git. To contribute to the scripts accessible via robonaut (the bot), you'll need an account on Babbage.


First time config

Before you can start committing to the git repository, you need to configure your account on babbage appropriately.

* git config --global user.name "Jane Doe" # This will set your name in git.
* git config --global user.email foo@test.com # This sets your email address.

This only needs to be ran once. Once done, you can jump straght to the next section.

Committing

First of all, create and edit the files as per usual. Now, to see to it that they're committed to the repo, do the following:

* git add file1 file2 file3 # This tells git which files you want to commit the changes for. You can always get an overview of what files have changed since the last commit by running git status.
* git commit -m "A useful, but short, message on the changes" # This actually commits these changes, and attaches the comment after -m to the change to make it easy to see what changes you made at a glance.

Now, you'll need to switch to the root user on babbage. As root:

* git push #  This makes your changes available on the github repository, and thus available to others.