Git

From ITSwiki
Revision as of 14:27, 18 October 2012 by Mttj (Talk | contribs)


Jump to: navigation, search

How to get an account?

IMM employees and P.hD's can get a git account by sending an email to IT Service with your SSH public key which you find in ~/.ssh/*pub. E.g. ~/.ssh/id_rsa.pub.

If you don't have a publick then you can create one by

ssh-keygen -N '' -t rsa -f ~/.ssh/id_rsa

It is important that you keep your private key (~/.ssh/id_rsa) and public key safe and have a backup. Should someone get hold of your private key, then all your git repositories can get accessed by that person.

Disk space

By default the git admin get 1GB of disk space and a hard limit of 1,5GB, where all the git admin's repositories combined can not exceed these limits.

This means that if you have created e.g. 3 repos and have added some users to these, and if just one of these users adds a big file by mistake, and exceed the 1GB limit, then no one will be allowed to push to any of the git admin's repos.

If the disk usage is e.g. 900MB, and a user pushes a commit of 700MB, then the file system will stop writing when 1,5GB is reached, and there is a potential data loss for the repos owned by the git admin.

Linus is not shy to say that Git is not designed to contain big binary blobs. [Example].

So 1GB is an enormous amount of space, if your uses use it as intended, so these limits should never be a problem. The limits are there however to protect the other git admin's repos, so a user from gitAdmin1 can not impact other admins' repos.

If you have a need for version control on big amounts binary blobs of data (e.g. images), then please contact IT Service and will try to find a solution for this.

Deleting a big commit

More about this later.

Creating repositories and setting permissions

Once your account have been created, you can clone the gitolite-admin repo by

git clone dtuInitials@git.imm.dtu.dk:gitolite-admin

where dtuInitials should be replaced by your IMM initials which are 4 or more letters long.

This repository is where you create repositories, add users, and set permissions for the users.

Create repository

Add user to repository