配置Windows下的Git 伺服器簡易教程

來源:互聯網
上載者:User
  • 下載

msysGit

TortoiseGit

WampServer2

  • 配置Git

             cd C:\Program Files\Git\libexec\git-core             copy C:\Program Files\Git\bin\libiconv-2.dll                        git-http-backend.exe 

  • 配置Apache

修改httpd.conf :

<directory />Options FollowSymLinksAllowOverride NoneOrder deny,allowAllow from all</directory>

在 httpd.conf 檔案末尾追加:

# Set this to the root folder containing your Git repositories.SetEnv GIT_PROJECT_ROOT E:/SvnServer# 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 1# 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/Git/libexec/git-core/git-http-backend.exe/$1″ <Location />AuthType BasicAuthName “GIT ServerAuthUserFile “E:/SvnServer/htpassword”Require valid-user</Location>

  • 添加使用者

切換到 Apache 安裝目錄下的 bin目錄

htpasswd -cmb E:/SvnServer/htpassword mythma 123456

  • 建立代碼倉庫

cd E:\GitServergit init --bare mythma.gitgit update-server-info


  • 用戶端

使用TortoiseGit clone

git add .

git commit -m "Add"

git push origin master

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.