このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン 両方とも次のリビジョン | ||
git2:server [2020/06/04 17:04] y2sunlight [リポジトリの設定] |
git2:server [2020/06/16 15:16] y2sunlight [Smart HTTPプロトコルによる接続] |
||
---|---|---|---|
行 28: | 行 28: | ||
* Gitサーバーの構築 - Gitデーモン/ | * Gitサーバーの構築 - Gitデーモン/ | ||
- | * [[git: | + | * [[git2: |
+ | * [[git2:client:windows|Git Windowsクライアント]] | ||
リンク | リンク | ||
行 70: | 行 71: | ||
</ | </ | ||
- | ここで設定した内容は '' | + | ここで設定した内容は '' |
\\ | \\ | ||
行 118: | 行 119: | ||
<code sh> | <code sh> | ||
# これらのコマンドは、リポジトリディレクトリ(例:/ | # これらのコマンドは、リポジトリディレクトリ(例:/ | ||
- | git config daemon.uploadpack false # upload-pack を無効にする。 | ||
- | git config daemon.uploadarch true # uploadarch を有効にする。 | ||
git config daemon.receivepack true # receivepack を有効にする。 | git config daemon.receivepack true # receivepack を有効にする。 | ||
</ | </ | ||
行 284: | 行 283: | ||
SmartHTTP プロトコルは、Git HTTPバックエンド([[https:// | SmartHTTP プロトコルは、Git HTTPバックエンド([[https:// | ||
- | | + | |
- | * http.receivepack — git send-pack を提供し、クライアントに '' | + | |
+ | * http.receivepack — '' | ||
+ | |||
+ | <div indent> | ||
+ | > | ||
+ | </ | ||
HTTPバックエンドのデフォルト動作では、信頼のある特定の内部ネットワークからも '' | HTTPバックエンドのデフォルト動作では、信頼のある特定の内部ネットワークからも '' | ||
行 295: | 行 299: | ||
\\ | \\ | ||
- | |||
==== Apache2.4のインストール ==== | ==== Apache2.4のインストール ==== | ||
行 310: | 行 313: | ||
\\ | \\ | ||
- | |||
- | |||
==== Apacheの設定 ==== | ==== Apacheの設定 ==== | ||
行 326: | 行 327: | ||
{{fa> | {{fa> | ||
<code int git.conf> | <code int git.conf> | ||
- | # | + | # 環境設定 |
SetEnv GIT_PROJECT_ROOT /var/git | SetEnv GIT_PROJECT_ROOT /var/git | ||
SetEnv GIT_HTTP_EXPORT_ALL | SetEnv GIT_HTTP_EXPORT_ALL | ||
行 412: | 行 413: | ||
例: | 例: | ||
< | < | ||
- | git clone http:// | + | git clone http:// |
- | git clone http// | + | git clone http// |
</ | </ | ||
行 428: | 行 429: | ||
</ | </ | ||
- | ローカルリポジトリを変更してコミットします。 | + | ローカルリポジトリを変更して |
<code sh> | <code sh> | ||
行 435: | 行 436: | ||
git add . # ファイルをインデックスに追加する | git add . # ファイルをインデックスに追加する | ||
git commit -m "First Commit" | git commit -m "First Commit" | ||
- | 1 file changed, 1 insertion(+) | ||
- | | ||
</ | </ | ||
- | ローカルリポジトリの変更内容をリモートリポジトリに送信します。 | + | ローカルリポジトリの変更内容をリモートリポジトリに |
<code sh> | <code sh> | ||
- | git commit -m "First Commit" | + | git push origin master |
- | 1 file changed, 1 insertion(+) | + | |
- | | + | |
</ | </ | ||
- | < | + | \\ |
- | git push ... | + | |
+ | ===== Gitサーバーの運用 ===== | ||
+ | |||
+ | Gitサーバーの運用の運用についてのユースケースをまとめておきます。 | ||
+ | |||
+ | {{fa> | ||
+ | |||
+ | < | ||
+ | cd / | ||
+ | git init --bare --shared ./ | ||
+ | chown -R apache: | ||
+ | |||
+ | cd ./ | ||
+ | git config http.receivepack true # receivepack(git push) を有効にする | ||
+ | </ | ||
+ | |||
+ | {{fa> | ||
+ | |||
+ | < | ||
+ | cd / | ||
+ | htpasswd -c .htpasswd USER # 新しいユーザ(例: | ||
+ | New password: | ||
+ | Re-type new password: | ||
+ | </ | ||
+ | |||
+ | {{fa> | ||
+ | |||
+ | < | ||
+ | git clone http://192.168.1.100/ | ||
+ | git clone git:// | ||
+ | </ | ||
+ | |||
+ | {{fa> | ||
+ | |||
+ | < | ||
+ | cd / | ||
+ | rm -rf ./ | ||
</ | </ | ||
\\ | \\ | ||