Bonobo Git Server是一個運行在IIS6/7、MVC 3、.net 4.0平台基礎之上的開源GIT原始碼伺服器。下面將Windows Server 2008 R2下安裝過程分享一下:
1、環境準備
msysGit
TortoiseGIT
在 Windows Server 2008 R2 上安裝 IIS 7.5
Microsoft .NET Framework 4.0
ASP.NET MVC 3
2、下載Bonobo Git Server安裝包並解壓
3、下載64位版本的 System.Data.SQLite 替換/bin/目錄下的同名dll檔案
4、將解壓並替換dll檔案後的整個目錄拷貝至目標路徑,可是是預設的 c:inetpubwwwroot目錄,也可以單獨配置一個git子網域名稱,這裡我選擇後者,注意:應用程式集區要選擇ASP.NET v4.0
5、配置App_Data目錄許可權為“完全控制”,在目錄上點擊滑鼠右鍵 —>>> 屬性 —>>> 安全 —>>> 編輯
6、開啟瀏覽器輸入http://localhost/Bonobo.Git.Server或步驟5添加的子網域名稱(例如http://git.chiefleo.me/),以預設管理員身份登入:使用者名稱-admin,密碼-admin
7、在“Global Settings”中指定程式碼程式庫的根目錄,並設定好該目錄的檔案系統許可權(需要有寫入權限)
8、建立程式碼程式庫:Repositories —>>> Create New Repository —>>> 輸入程式碼程式庫相關資訊 —>>> 建立完畢,點擊程式碼程式庫名稱,就可以看到相應的Git Repository Location,以後可根據此連結clone、pull、push代碼了~
GIT使用問題匯總:
1、安裝BONOBO GIT SERVER以後,通過http://localhost/Bonobo.Git.Server或子網域名稱訪問,頁面顯示為空白。
解決方案:參考上述步驟5,配置App_Data目錄許可權為“完全控制”
2、GIT push比較大的檔案時,彈出錯誤提示:
Pushing to http://git.chiefleo.me/Git.aspx/xxx
fatal: protocol error: bad line length character: <!DO
fatal: The remote end hung up unexpectedly
error: RPC failed; result=55, HTTP code = 200
解決方案:開啟web.config,在 <system.web> 節點下設定最大請求長度(maxRequestLength)為102400000,在<system.webServer>節點下,設定最大允許內容長度(maxAllowedContentLength)為102400000,相關代碼如下:
代碼如下 |
複製代碼 |
<system.web> <httpRuntime maxRequestLength="102400000" /> ... </system.web> <system.webServer> ... <security> <requestFiltering> <requestLimits maxAllowedContentLength="102400000" /> </requestFiltering> </security> </system.webServer> |