Git ãªãã¸ããªã WebDAV ã§æ±ã
Git ã«ææ¦ãã¦æªæ¦è¦éã®æ«ã« WebDAV çµç±ã§ä½¿ããããã«ãªã£ãã®ã§ã¡ã¢ã£ã¨ãã
ã¡ã¤ã³ãªãã¸ããªãç½®ããµã¼ã㯠CentOS 5.4 ã« git-1.5.2.1-1.el5.rf
ã¯ã©ã¤ã¢ã³ã㯠Win7 + msysGit git version 1.6.5.1.1367.gcd48
Apache ã® WebDAV è¨å®
/var/www/gitrepos/ 以ä¸ã«ãªãã¸ããªãç½®ããã¨ã«ãã¦ãå¤ãã㯠http://ï¼ï¼ï¼/git/ãªãã¸ããªå ã§ã¢ã¯ã»ã¹ããããã«ããã
è¨å®ã¯ git.conf ã«æ¸ãã¦ãåèµ·å
# emacs /etc/httpd/conf.d/git.conf
Alias /git/ /var/www/gitrepos/ <Location /git/> DAV on AuthType Basic AuthName "Git" AuthUserFile /var/www/gitrepos/.htpasswd Require valid-user </Location>
# /etc/init.d/httpd restart
Git ãªãã¸ããªã®ä½æ
ãã¹ãã¨ã㦠test.git ã¨ãããªãã¸ããªãä½ãã
# cd /var/www/gitrepos/ # mkdir test.git # ãã£ã¬ã¯ããªãä½ã£ã¦ # cd test.git/ # git --bare init --shared=true # ãªãã¸ããªåæå Initialized empty shared Git repository in /home/gitrepos/test.git/ # git --bare update-server-info # chown -R apache: . # WebDAV çµç±ã§æ±ããããªã¼ãã¼ã apache:apache ã«å¤æ´
ãã㧠http://ãµã¼ãå/git/test.git ã«ã¢ã¯ã»ã¹ããã° test.git ãªãã¸ããªãæä½ã§ããããã«ãªãã
ã¯ã©ã¤ã¢ã³ã㧠clone & commit & push
C:\>git clone http://ã¦ã¼ã¶å@ï¼ï¼ï¼/git/test.git test # clone ãã Basicèªè¨¼ãããã㯠ã¦ã¼ã¶å@ ãå¿ããã« Initialized empty Git repository in C:/test/.git/ Password: # ãã¹ã¯ã¼ãå ¥å warning: You appear to have cloned an empty repository. C:\>cd test C:\test>touch test.txt # é©å½ã«ãã¡ã¤ã«ãä½ã£ã¦ add C:\test>git add test.txt C:\test>git commit -m "init commit" # é©å½ã« commit [master (root-commit) 8816b32] init commit 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.txt C:\test>git push origin master # ãªã¢ã¼ããªãã¸ããªã« push Password: Fetching remote heads... refs/ refs/tags/ refs/heads/ updating 'refs/heads/master' from 0000000000000000000000000000000000000000 to 8816b323d4d5a0727110bf74c9d517dd376ec737 sending 3 objects done Updating remote server info C:\test> cd .. # push ã§ãããå¥ãã£ã¬ã¯ããªã« clone ãã¦ã¿ã C:\>git clone http://ã¦ã¼ã¶å@ï¼ï¼ï¼/git/test.git test2 Initialized empty Git repository in C:/test2/.git/ Password: # ãã¹ã¯ã¼ãå ¥å C:\>dir test2 ãã©ã¤ã C ã®ããªã¥ã¼ã ã©ãã«ã¯ RamDisk-PAE ã§ã ããªã¥ã¼ã ã·ãªã¢ã«çªå·ã¯ 1234-5678 ã§ã C:\test2 ã®ãã£ã¬ã¯ã㪠2010/04/21 17:22 <DIR> . 2010/04/21 17:22 <DIR> .. 2010/04/21 17:22 0 test.txt 1 åã®ãã¡ã¤ã« 0 ãã¤ã 2 åã®ãã£ã¬ã¯ã㪠461,811,712 ãã¤ãã®ç©ºãé å