Git

Git is a modern distributed revision control / software configuration management project created by Linux kernel developer Linus Torvalds.

We provide:

Git servers are currently impossible due as TCP port 9418 is blocked.

Creating a new repository

set -e
PROJECT="testproject"
DESCRIPTION="A test project"

sudo addgroup git-${PROJECT}
sudo mkdir /var/lib/git/${PROJECT}.git
cd /var/lib/git/${PROJECT}.git

sudo git --bare init-db --shared=group

sudo chown -R :git-${PROJECT} .
sudo chmod 755 hooks/post-update  

echo "${DESCRIPTION}" | sudo tee description > /dev/null
sudo touch git-daemon-export-ok

NB. You cannot pull from an empty repository - you should first push to the repository using the --all switch.

Adding users

sudo adduser <user> git-${PROJECT}

It is not recommended you add every contributor to the group: add only those required to update the UWCS repository.

Removing users

sudo deluser <user> git-${PROJECT}

Cloning from / pushing to a repository

The following commands will clone a repository:

git clone uwcs.co.uk:/git/PROJECT
git clone uwcs.co.uk:/var/lib/git/PROJECT
git clone ssh://uwcs.co.uk/git/PROJECT
git clone ssh://uwcs.co.uk/var/lib/git/PROJECT
git clone http://git.uwcs.co.uk/repo/PROJECT
git clone http://git.warwickcompsoc.co.uk/repo/PROJECT

The following commands will push to a repository:

git push [--all] [--tags] uwcs.co.uk:/git/PROJECT
git push [--all] [--tags] uwcs.co.uk:/var/lib/git/PROJECT
git push [--all] [--tags] ssh://uwcs.co.uk/git/PROJECT
git push [--all] [--tags] ssh://uwcs.co.uk/var/lib/git/PROJECT

Deleting a repository

PROJECT="testproject"
sudo rm -rf /var/lib/git/${PROJECT}.git
sudo groupdel git-${PROJECT}

Techteam Wiki: Services/Git (last edited 2007-09-21 13:54:02 by cpc3-cove7-0-0-cust123)