Difference between revisions of "Creating Shared Git Repo"

From LSDevLinux
Jump to: navigation, search
(Create an empty repo: Use "git.lsdev.sil.org" rather than "rahab")
(Create an empty repo: Add cloneurl and reorganize)
Line 6: Line 6:
 
  rahab:$ git config --global user.name "YOUR NAME"
 
  rahab:$ git config --global user.name "YOUR NAME"
 
  $ git config --global user.email "some@email_maybe"
 
  $ git config --global user.email "some@email_maybe"
 +
$ newgrp lsdevrepo
 
  $ cd /srv/git/lsdev/public
 
  $ cd /srv/git/lsdev/public
  $ git init --bare --shared=group PROJECTNAME.git
+
  $ mkdir PROJECTNAME.git
$ touch PROJECTNAME.git/git-daemon-export-ok
 
 
  $ cd PROJECTNAME.git
 
  $ cd PROJECTNAME.git
 +
$ git init --bare --shared=group
 +
$ umask 2
 +
$ touch git-daemon-export-ok
 +
$ echo git://git.lsdev.sil.org/PROJECTNAME.git >cloneurl
 +
 +
To enable http access:
 +
 
  $ git --bare update-server-info
 
  $ git --bare update-server-info
 
  $ chmod +x hooks/post-update
 
  $ chmod +x hooks/post-update
$ chgrp -R lsdevrepo .
 
  
 
Others can clone this repository using:
 
Others can clone this repository using:
 
  $ git clone ssh://USERNAME@git.lsdev.sil.org/srv/git/lsdev/public/PROJECTNAME.git
 
  $ git clone ssh://USERNAME@git.lsdev.sil.org/srv/git/lsdev/public/PROJECTNAME.git
 
or
 
or
  $ git clone http://git.lsdev.sil.org/PROJECTNAME.git
+
  $ git clone <nowiki>http://git.lsdev.sil.org/PROJECTNAME.git</nowiki>
 
or
 
or
 
  $ git clone git://git.lsdev.sil.org/PROJECTNAME.git
 
  $ git clone git://git.lsdev.sil.org/PROJECTNAME.git

Revision as of 17:50, 18 November 2010

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

Create an empty repo

local-workstation:$ ssh git.lsdev.sil.org
rahab:$ git config --global user.name "YOUR NAME"
$ git config --global user.email "some@email_maybe"
$ newgrp lsdevrepo
$ cd /srv/git/lsdev/public
$ mkdir PROJECTNAME.git
$ cd PROJECTNAME.git
$ git init --bare --shared=group
$ umask 2
$ touch git-daemon-export-ok
$ echo git://git.lsdev.sil.org/PROJECTNAME.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://USERNAME@git.lsdev.sil.org/srv/git/lsdev/public/PROJECTNAME.git

or

$ git clone http://git.lsdev.sil.org/PROJECTNAME.git

or

$ git clone git://git.lsdev.sil.org/PROJECTNAME.git

Pushing is possible with:

$ git push ssh://USERNAME@git.lsdev.sil.org/srv/git/lsdev/public/PROJECTNAME.git

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://USERNAME@git.lsdev.sil.org/srv/git/lsdev/public/PROJECTNAME.git
$ cd PROJECTNAME
$ 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:

http://git-scm.com/

http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html

http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#public-repositories