LoginSignup
5
6

More than 5 years have passed since last update.

Git 環境構築 ~ Smart HTTP

Posted at

環境

サーバーマシン:Windows 7
Web サーバー:Apache 2.2(xampp)

Git インストール

より、msysGit をダウンロードしてインストール。
設定は特にいじらずインストール。

より、TortoiseGit と日本語パッチをダウンロードしてインストール。

Apache の設定変更

Apache の設定を次のように変更。

httpd.conf
SetEnv GIT_PROJECT_ROOT "C:/usr/gitreps"
SetEnv GIT_HTTP_EXPORT_ALL

#↓ネットのサンプルでは必要とあったが、なくても動作した。
#SetEnv REMOTE_USER REDIRECT_REMOTE_USER
ScriptAlias /repos/ "C:/Program Files/Git/libexec/git-core/git-http-backend.exe/"

<Directory "C:/Program Files/Git/libexec/git-core/">
    Options +ExecCGI
    Order allow,deny
    Allow From All
</Directory>

<Location "/repos">
    Options Indexes
    AuthType Digest
    AuthName "Git"
    AuthUserFile "C:/usr/gitreps/.htpasswd_dig"
    Require valid-user
    Allow from all
</Location>

パスワードファイルの生成

最後にパスワードファイルの作成。
今回は Digest 認証なので、htdigest.exe を使用。

C:\xampp\apache\bin\htdigest -c C:/usr/gitreps/.htpasswd_dig "Git" <ユーザー名>

apache の再起動。

最後に

ブラウザでは正常にアクセスできませんでした。。。
TortoiseGit からは正常にプッシュ、プルできました。

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6