Gitãªãã¸ããªãWebDAV(+https)çµç±ã§å ¬éãã
è²ã ãã£ããã©ããã§åºæ¥ãã
ã¤ã³ã¹ãã¼ã«
# yum -y instal git-core
WebDAVã®è¨å®
- /mnt/drbd/www/gitãwebdavã§å ¬éãã
- htpasswdã¯/mnt/drbd/www/.htpasswdã«ããã®ãåæ
- apacheã§webdavã®ç°å¢æ§ç¯æ¸ã¿ã§ããã®ãåæ
# vim /etc/httpd/conf.d/git.conf Alias /git /mnt/drbd/www/git <Location "/git"> DAV on SSLRequireSSL AuthType Basic AuthName "Git" AuthUserFile /mnt/drbd/www/.htpasswd <Limitexcept GET HEAD PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> </Location>
è¨å®ãããåæ
# /etc/init.d/httpd reload
Gitãªãã¸ããªã®ä½æ
# cd /mnt/drbd/www/git/ # mkdir projects.git # cd projects.git # git --bare init # vim description é©å½ã«descriptionãæ¸ã # echo "https://yamkazu.org/git/projects.git" > cloneurl # printf "[gitweb]\n\towner = Kazuki YAMAMOTO\n" >> config # chmod +x hooks/post-update # git update-server-info # cd .. # chown -R apache.apache projects.git
ã¯ã©ã¤ã¢ã³ãã®æºå
httpsã使ãã«ã¯curlã«ãªãã·ã§ã³ã¤ãã¦ã¤ã³ã¹ãã¼ã«ããªãã¨ãã¡ãªã®ã§ãã¤ãã¦ãªãå ´åã¯ä¸åº¦ã¢ã³ã¤ã¹ãã¼ã«ã
# sudo port uninstall git-core # sudo port uninstall curl
httpsã¢ã¯ã»ã¹ã®çºã®è¨å®
# sudo port edit curl configure.argsã®without-sslãwith-sslã«å¤æ´
ã¤ã³ã¹ãã¼ã«
# sudo port install curl # sudo port install git-core
ãªã¬ãªã¬è¨¼ææ¸ã¯GIT_SSL_NO_VERIFY=1ãã¤ããªãã¨èªè¨¼ãéããªããæ¯åã¤ããã®ãé¢åãªã®ã§aliasã«è¨å®ãã¦ãã¾ãã
# vim ~/.bashrc 以ä¸ã追å alias git='GIT_SSL_NO_VERIFY=1 git'
èªè¨¼æ å ±ã®è¨å®
# vim ~/.netrc machine yamkazu.org login <ã¦ã¼ã¶ã¼å> password <ãã¹ã¯ã¼ã>
ãã¼ããã·ã§ã³ãå¤æ´
# chmod 600 ~/.netrc
åä½ç¢ºèª
# git clone http://yamkazu.org/git/projects.git # cd projects # touch README.txt # git add README.txt # git commmit -m "test" # git push origin master
pushåºæ¥ã¦ããã確èªããçºãé©å½ãªå ´æã§cloneããã
# git clone http://yamkazu.org/git/projects.git # ls projects
ãã£ãcommitããREADME.txtãããã°OKã