Creating Shared Git Repo

From LSDevLinux
Revision as of 17:50, 18 November 2010 by Mayhewn (talk | contribs) (Create an empty repo: Add cloneurl and reorganize)

Jump to: navigation, search

Instructions to create a public git repository on our semi-public git repo host

Create an empty repo

local-workstation:$ ssh
rahab:$ git config --global "YOUR NAME"
$ git config --global "some@email_maybe"
$ newgrp lsdevrepo
$ cd /srv/git/lsdev/public
$ mkdir PROJECTNAME.git
$ git init --bare --shared=group
$ umask 2
$ touch git-daemon-export-ok
$ echo git:// >cloneurl

To enable http access:

$ git --bare update-server-info
$ chmod +x hooks/post-update

Others can clone this repository using:

$ git clone ssh://


$ git clone


$ git clone git://

Pushing is possible with:

$ git push ssh://

Filling with content

After you created the shared repo you might want to add some existing files, or at least commit a dummy file to prevent a warning when cloning the repo (warning: You appear to have cloned an empty repository.):

local-workstation:$ git clone ssh://
$ cp -a ~/some/files/to/copy . && git add . # copy existing files
$ echo > dummy && git add dummy # or create a dummy file
$ git commit -m "Initial commit"
$ git push origin master

Helpful resources: