Windows gitweb安裝

/*******************************************************************************
 *                        Windows gitweb安裝
 * 說明:
 *     git倉庫經過瀏覽器進行代碼review是不錯的選擇,嘗試一下gitweb,感受速度有點慢;
 *
 *                                2019-3-31 深圳 寶安西鄉 曾劍鋒
 ******************************************************************************/

1、參考文檔
    1. Windows上搭建GitWeb
        http://ju.outofmemory.cn/entry/153846
    2. 安裝並測試Gitweb
        https://blog.csdn.net/yanyuanfen2011/article/details/62217845

2、處理步驟
    1. 下載xampp,利用其中的apache做爲Web Server;
    2. gitweb在git安裝相對路徑:<git install path>\Git\mingw64\share\gitweb
    3. httpd.conf最後添加以下內容
        # Config to make the gitweb CGI available through Apache.
        Alias /gitweb "D:\Software\git\install\Git\mingw64\share\gitweb"
        <Directory "D:\Software\git\install\Git\mingw64\share\gitweb">
            AddHandler cgi-script .cgi
            <Files ~ "\.cgi$">
                Options +ExecCGI
            </Files>
            AllowOverride None
            Require all granted
            DirectoryIndex gitweb.cgi
        </Directory>
    4. 下載CGI.PM:https://github.com/leejo/CGI.pm,存放到:<git install path>\Git\usr\lib\perl5\vendor_perl
    5. 修改<git install path>\Git\mingw64\share\gitweb\gitweb.cgi
        #!D:/Software/git/install/Git/usr/bin/perl

        [...省略]

        # core git executable to use
        # this can just be "git" if your webserver has a sensible PATH
        our $GIT = "D:/Software/git/install/Git/bin/git.exe";

        # absolute fs-path which will be prepended to the project path
        our $projectroot = "/D/zengjf/SWDev/github";
    6. 若是出現長時間訪問未刷新頁面,可能目錄訪問權限的問題,在git shell中執行:chmod 777 -R <your repositories>
    7. 若是以爲原生的gitweb主題很差看,能夠替換:http://kogakure.github.io/gitweb-theme/
相關文章
相關標籤/搜索