From Sit
Jump to: navigation, search
Outdated icon32.png The information in this article (or section) is out of date needs updating.
Please help us and our readers by clicking the edit link above and updating/improving this text.

We're using Git distributed version control for our SiT! development for version 4.0 and beyond. This page explains how to download the source code for SiT! and make changes to it. You can also participate in our project by sending your changes to us.

Warning Warning:  We've moved our source code repository to Github, see - These instructions are out of date and this page needs updating. Please help if you can.


Get a copy of the SiT! Source code

If you don't want to make any changes to SiT, you can grab the latest version as a ZIP from: or if you prefer a git copy:

git clone

Git for patchers

  1. Register for an account over a Gitorious
  2. Click on the SiT account page
  3. Click 'Clone this repository on Gitorious' - this will create a copy of SiT's code for you to work on
  4. The following applies to *nix and Mac OS X, Windows users will need to perform this with a GUI tool for Git (e.g.
    $ git config --global "Name"
    $ git config --global ""
  5. Next we need to download your copy of the code, on Gitorious, click your name at the top right. Under 'Your Repositories' you will have ~name/sit/name-sit - click this
  6. In the box at the top there will be a command which starts 'git pull', run that on your command line:
    git clone
  7. Make your changes to SiT
  8. Now we need to give our changes back:
     git commit -am "Fix bug 123"
    git push<NAME>/sit/<NAME>-sit.git # (This is underneath your git clone address on Gitorious)
  9. Back on your Gitorious page, click 'Request merge' and enter a description and comment of your changes


NOTE: If you plan to keep submitting patches, it is useful to keep your code up to date with the latest development code. Please follow Add SiT repo as a remote branch and Keep your personal branch up to date with SiT in the Developer's section.

Git for developers

First follow steps 1 through 6 in the Git for patchers section above.

Add SiT's repo as a remote branch

Go to your local git repository and start the following commands.

$ git remote add sit
$ git fetch sit
$ git checkout -b sit sit/master

Keep your personal branch up to date with SiT's

Make sure you are have your master branch checked out (i.e. $ git checkout master)

$ git fetch sit
$ git merge sit/master

Making a change to SiT's code

This doesn't have to be done in full every time, but for completeness:

$ git checkout master
$ vim file.php # make changes
$ git commit -am "fix a bug" # to commit all changed files, remove the -a to just specify files
$ git push origin master
$ git checkout sit # make sure you are up to date, see steps below
$ git merge master -m "Some changes to foo to fix foobar" # pulls in your bug fix
$ git push sit master

Create a branch

git b branchname # creates your local branch branchname
git push repository branchname # pushes the branch branchname to repository e.g. origin

Delete a branch

$ git branch -d branchname # deletes your local branch branchname
$ git push repository :branchname # deletes the remote branch branchname at repository e.g. origin

Track another developer's branch

$ git remote add johnsmith git://
$ git fetch johnsmith
$ git checkout -b johnsmith johnsmith/master

Create a tag

$ git co sit   # optional step, only required if you want to tag the main repo
$ git tag -m"tag create message" tagname <branch you want to create the tag on> # for a release the branch is sit
$ git push sit --tags

List tags

$ git tag -l

Delete a tag

$ git tag -d tagname
$ git push branchname :tagname # branchname would be sit if deleting a release branch

Adding git's current branch to bash

No more merging with the wrong branch! Add the following code to your ~/.bashrc to get a prompt like: [kieran@kieran-netbook:~/Code/sit(master)]

function parse_git_branch {
  git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'

function proml {
  case $TERM in

PS2='> '
PS4='+ '

Resolving Conflicts

Git-mergetool provides an easy way to get conflict resolution started. It'll use the diff tool that you have installed and it works great with kdiff3.

git mergetool

Undo an edited file before it was commited

If you've edited a file and saved it, and find out that it was a mistake, or deleted the file for that matter, you can go back to what the file was like from last commit/push by

git checkout myfile

Known problems

Some people have run into a bug of Gitorious, which results in the error message:

 fatal: protocol error: expected sha/ref, got '�
 The git:// protocol is read-only.
 Please use the push url as listed on the repository page.

A solution for this is described here:

See Also

Personal tools