*重要1:Git 在Windows對於UTF-8 支援不好,使用時請三思,確定檔名和記錄只會使用英文撰寫(此問題已在最新版本修正)
2:Git 初部練習並不需要架APACH, 如果入門者,請先學好Git 再架網頁型資料庫
3:請先對GIT 的資料庫有初步認識,以及正則表達式的初部認識,在操做下面配置才能了解原理
1.apache 安裝
2.下載svn 到此下載http://code.google.com/p/msysgit/downloads/list?can=3,我使用Git-1.7.7.1-preview20111027.exe
3.安裝 git
照以下圖示安裝
注意此處指檔案內部換行符要什麼模式,我是選第1項
4.開啟apache 安裝資料夾,我的是C:\Program Files (x86)\Apache Software Foundation\Apache2.2
如果是XP 或32位元win7系統則會是C:\Program Files\Apache Software Foundation\Apache2.2
5.找conf 資料夾中的httpd.conf 檔,並用記事本軟體開啟編輯。
6.找到
7.接著在最下面加入以下內容Options FollowSymLinks AllowOverride None Order deny,allow Allow from all
#Set this to the root folder containing your Git repositories. SetEnv GIT_PROJECT_ROOT E:/DataBase/GIT # Set this to export all projects by default (by default, # git will only publish those repositories that contain a # file named “git-daemon-export-ok” SetEnv GIT_HTTP_EXPORT_ALL # Route specific URLS matching this regular expression to the git http server. ScriptAliasMatch \ "(?x)^/git/(.*/(HEAD | \ info/refs | \ objects/(info/[^/]+ | \ [0-9a-f]{2}/[0-9a-f]{38} | \ pack/pack-[0-9a-f]{40}\.(pack|idx)) | \ git-(upload|receive)-pack))$" \ "C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe/$1"PS.1.(?x)^/git/ 指apache http://你的網址路徑/git/AuthType Basic AuthName "GIT Repository" AuthUserFile "E:/DataBase/Access/Account.conf" Require valid-user
2.SetEnv GIT_PROJECT_ROOT E:/DataBase/GIT 此行指專案路徑
3."C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe/$1" 指能讓HTTP取出資料庫的程式
參考
1.http://huan-lin.blogspot.com/2011/05/install-git-server-and-apache-on.html
2.http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/zh_tw/
如果想支援 git-svn 中文
2.http://oznyang.iteye.com/blog/993195
3.http://3ad73f86.dotcloud.com/?p=175