Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

01.05 Git Howto

stuindhamma edited this page Jul 29, 2014 · 1 revision

Git Howto

Common Tasks

Clone an existing (remote) repository

git clone git@git.suttacentral.net:cool-project.git

Create a new local repository

mkdir cool-project
cd cool-project
git init
touch a b c
git add .
git commit -m 'My first commit'

Push a local repository to git.suttacentral.net:

git remote add origin git@git.suttacentral.net:cool-project.git
git push origin master

Administrative (Gitolite)

Add new user to Gitolite

cd path/to/local/gitolite-admin

Create a new file in the keydir folder with a username ending in .pub. For example, if you wanted to add the user joe, create a file called keydir/joe.pub with the contents of their public SSH key, e.g:

ssh-rsa AAAAB3NzaC1...Urw== joe@example.com

Commit and push changes:

git add keydir/joe.pub
git commit -m 'Add user joe'
git push

Add/change permissions for remote repository

cd path/to/local/gitolite-admin

Edit conf/gitolite.conf:

repo    cool-project
        RW+     =   me admin
        RW      =   dev1 dev2
        R       =   gitweb

Note, R = gitweb makes this repository publicly visible at http://git.suttacentral.net/.

Commit and push changes:

git add conf/gitolite.conf
git commit -m 'Add cool-project repository'
git push

Additional Documentation

Clone this wiki locally