How to use gitolite on git.cs
Introduction
The gitolite shared version control system is installed on git.cs.
It is configured to allow any user to create git repositories under
users/their-username/.
Currently, to get a gitolite account on this server, you have to e-mail
your ssh public key (e.g. id_rsa.pub) to
fhgunn@cs. We will automate
this before students need to use it for course work.
CSCF currently has no commitment to support gitolite and git.cs; it's
still an experimental service for evaluation. However, it looks promising
and we would like your comments.
Getting started
If you haven't used git version control on linux.student.cs before,
first tell it who you are. It stores this information in the file
.gitconfig in your home directory. E.g.:
$ ssh linux.student.cs
linux024$ git config --global user.name "Frodo Baggins"
linux024$ git config --global user.email fbaggins@uwaterloo.ca
linux024$ git config --global --list
user.name=Frodo Baggins
user.email=fbaggins@uwaterloo.ca
Example use
Here's an example of how to use gitolite on git.cs:
$ ssh linux.student.cs
linux024$ ssh git@git.cs help
hello fbaggins, this is gitolite3 v3.5.2-10-g437b497 on git 1.7.9.5
list of remote commands available:
desc
help
info
perms
writable
linux024$ ssh git@git.cs info
hello fbaggins, this is git@git running gitolite3 v3.5.2-10-g437b497 on git 1.7.9.5
C users/CREATOR/..*
R W users/fbaggins/hello-world
R W users/fbaggins/test1
linux024$ mkdir -p /tmp/fbaggins && cd /tmp/fbaggins && chmod 700 .
linux024$ git clone git@git.cs:users/fbaggins/test2
Cloning into 'test2'...
warning: You appear to have cloned an empty repository.
linux024$ ssh git@git.cs info
hello fbaggins, this is git@git running gitolite3 v3.5.2-10-g437b497 on git 1.7.9.5
C users/CREATOR/..*
R W users/fbaggins/hello-world
R W users/fbaggins/test1
R W users/fbaggins/test2
linux024$ cd test2/
linux024$ echo 'Hello, world!' >README
linux024$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# README
nothing added to commit but untracked files present (use "git add" to track)
linux024$ git add README
linux024$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: README
#
linux024$ git commit -m 'Created README for initial content.'
[master (root-commit) f7f9215] Created README for initial content.
1 file changed, 1 insertion(+)
create mode 100644 README
linux024$ git status
# On branch master
nothing to commit (working directory clean)
linux024$ git log
commit f7f921557455f5f9840b8c1edafc6a0b499afcbc
Author: Frodo Baggins <fbaggins@uwaterloo.ca>
Date: Thu Oct 17 12:41:44 2013 -0400
Created README for initial content.
linux024$ git remote -v
origin git@git.cs:users/fbaggins/test2 (fetch)
origin git@git.cs:users/fbaggins/test2 (push)
linux024$ git push # This will fail while the remote is an empty repository.
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'git@git.cs:users/fbaggins/test2'
linux024$ git push --all
Counting objects: 3, done.
Writing objects: 100% (3/3), 246 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@git.cs:users/fbaggins/test2
* [new branch] master -> master
See also
--
FraserGunn - 2013-11-26