Johnathan Kong
Mark files as ignored
To mark files as ignore when doing a git add, create a .gitignore file in the directory and add the files that you want to be ignored.
1 | echo "<files>" > .gitignore |
Adding a User
Add a user using the gitosis
1 2 3 4 | get user to create a public key (ssh-keygen -t rsa (cmd works in the git bash for windows)) copy key do gitosis-admin/keydir rename key to username add user to gitosis under the proper groups |
Creating a repo
How to create a repo from any server. Before this step, you will have to edit your gitosis file to ensure that this repo exists in the “writable” and the user has permissions (put is name in the “members”).
1 2 3 4 5 6 7 8 | Create a repo directory if you don't have one already Change to the directory git init git remote add origin git@<your server>:<your repo>.git add/edit the files git add * git commit -m "<message>" git push origin master |
Editing gitosis.conf
This file is really easy to do, but I just wanted to have a reference as to the layout of the file
1 2 3 | [group <group name>] members = <members that have access. These are the names of your public key files (.pub)> writable = <repos that are part of the group that the members have access to> |
Git and Gitosis Quick Setup guide
Had a hell of a time getting this to work. Here are my exact deployment steps to get git up and running.
1 2 3 4 5 6 7 8 9 10 | apt-get install git-core
apt-get install gitosis
sudo adduser git
sudo mkdir /home/git/.ssh
sudo chown -R git:git /home/git/.ssh
sudo chmod 700 !$
ssh-keygen -t rsa
cp ~/.ssh/id_rsa.pub /tmp/my_key.pub
sudo -H -u git gitosis-init < /tmp/my_key.pub
git clone git@localhost:gitosis-admin.git |
Remove a staged file during a creation of a new repo
1 | git rm --cached [filename] |