Domain/Linux

git server daemon 설치하기

yhcting 2013. 6. 13. 13:37

Ubuntu 12.04 64 bit LTS


* git 을 설치


* server가 실행될 때 항상 실행되도록 Upstart Script 등록

/etc/init/<script name>.conf


<참고>

xxxx.conf : upstart script

xxxx.override : 기존의 xxxx.conf를 override함.


* /etc/init/git-daemon.conf 작성 (git project directory = /work/.prjrepo/)


start on runlevel [2345]                                                                        

stop on runlevel [!2345]                                                                        


expect fork                                                                                     

respawn                                                                                         


exec /usr/bin/git daemon --user=gitro --group=gitro --reuseaddr --base-path=/work/.prjrepo/ /work/.prjrepo/


* export하고자 하는 git repository안에 magic file인 git-daemon-export-ok 파일 생성 (size 0인 dummy file - 그냥 touch로 생성하면 된다.)


* client에서 test.

git clone git://<host>/<project>

<9418 포트 사용>