Hosting Your Own Git Repository on fedora 12
This tutorial will covering common feature in git repository
- commiting via ssh
- Enable gitweb for web access
- cloning anonymously using the Git protocol
Install git, git-daemon
1 | # yum -y install git git-daemon gitweb |
Create a git user/group
1 | # useradd -U -d /var/cache/git -s /usr/libexec/git-core/git-shell git |
Make sure the permissions of the directory are correct
1 | # cd /var/cache |
2 | # chown -R git:git git |
3 | # chmod 755 git |
We’ll be using SSH keys for authenication, so collect the public keys of all the users who need commit access. Then, put the public keys into the right place
1 | # cd /var/cache/git |
2 | # mkdir .ssh |
3 | # chmod 700 .ssh |
4 | # touch .ssh/authorized_keys |
5 | # chmod 600 .ssh/authorized_keys |
6 | (Put the public keys into authorized_keys, one per line) |
7 | # chown -R git:git .ssh/ |