Ground Sunlight

Windowsで作る - PHPプログラミングの開発環境

ユーザ用ツール

サイト用ツール


git2:server

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
git2:server [2020/06/04 22:54]
y2sunlight [リポジトリの設定]
git2:server [2020/06/16 15:20] (現在)
y2sunlight [Gitサーバーの運用]
行 29: 行 29:
   * Gitサーバーの構築 - Gitデーモン/Smart HTTP   * Gitサーバーの構築 - Gitデーモン/Smart HTTP
   * [[git2:server:git-web|Gitサーバーの構築 - Git Web]]   * [[git2:server:git-web|Gitサーバーの構築 - Git Web]]
-  * [[git:client:windows|Git Windowsクライアント]]+  * [[git2:client:windows|Git Windowsクライアント]]
  
 リンク リンク
行 71: 行 71:
 </code> </code>
  
-ここで設定した内容は ''~/.gitconfig'' に書き込まれます。+ここで設定した内容は ''~/.gitconfig'' に書き込まれます。''git config --list'' で設定内容が確認できます。
  
 \\ \\
行 119: 行 119:
 <code sh> <code sh>
 # これらのコマンドは、リポジトリディレクトリ(例:/var/git/sandbox.git)の中で実行する必要があります # これらのコマンドは、リポジトリディレクトリ(例:/var/git/sandbox.git)の中で実行する必要があります
-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 を有効にする。
 </code> </code>
行 285: 行 283:
 SmartHTTP プロトコルは、Git HTTPバックエンド([[https://git-scm.com/docs/git-http-backend|git-http-backend]])によって提供され、以下のサービスを提供します。 SmartHTTP プロトコルは、Git HTTPバックエンド([[https://git-scm.com/docs/git-http-backend|git-http-backend]])によって提供され、以下のサービスを提供します。
  
-  * ''http.uploadpack'' — git fetch-pack と git ls-remote (デフォルト有効) 
-  * ''http.receivepack'' — git send-pack を提供し、クライアントに ''git push'' を許可します。匿名ユーザーの場合はデフォルトで無効になり、Webサーバーで認証されたユーザーの場合はデフォルトで有効になります。 
  
-<div> +  * http.uploadpack — ''git fetch-pack'' と ''git ls-remote'' (デフォルト有効) 
- +  * http.receivepack — ''git send-pack'' を提供し、クライアントに ''git push'' を許可します。匿名ユーザーの場合はデフォルトで無効なりWebサーバーで認証されたユーザーの場合はデフォルトで有効になります
-''註:'' \\ 上の''http.receivepack''の説明は[[https://git-scm.com/docs/git-http-backend|GitReference]]よるが筆者の環境はBasic認証されている場合でも''http.receivepack'有効にならなかった+
  
 +<div indent>
 +>【注意】\\ 上の http.receivepack の説明は [[https://git-scm.com/docs/git-http-backend|GitReference]] によるが、筆者の環境ではBasic認証されている場合でも http.receivepack が有効にならなかった。
 </div> </div>
  
行 302: 行 299:
  
 \\ \\
- 
  
 ==== Apache2.4のインストール ==== ==== Apache2.4のインストール ====
行 317: 行 313:
  
 \\ \\
- 
- 
  
 ==== Apacheの設定 ==== ==== Apacheの設定 ====
行 333: 行 327:
 {{fa>folder-open-o}} ** /etc/httpd/conf.d ** {{fa>folder-open-o}} ** /etc/httpd/conf.d **
 <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
行 394: 行 388:
 Adding password for user y2sunlight Adding password for user y2sunlight
 </code> </code>
 +
 +>2回目以降は ''htpasswd .htpasswd new-user'' で ''-c''オプションは不要です。
  
 ''.htpasswd'' の内容は以下のようになっています。 ''.htpasswd'' の内容は以下のようになっています。
行 419: 行 415:
 例: 例:
 <code> <code>
-git clone http://localhost/git/sandboz.git +git clone http://localhost/git/sandbox.git 
-git clone http//192.168.1.100/git/sandboz.git+git clone http//192.168.1.100/git/sandbox.git
 </code> </code>
  
行 459: 行 455:
  
 <code> <code>
-cd /var/git                                 # リポジトリのルートディレクトリに移動する +cd /var/git                                 # 共有リポジトリのルートディレクトリに移動する 
-git init --bare --shared ./REPOSITORY.git   # 新しいリポジトリ(例:REPOSITORY)を作成する+git init --bare --shared ./REPOSITORY.git   # 新しい共有リポジトリ(例:REPOSITORY)を作成する
 chown -R apache:apache ./REPOSITORY.git     # ディレクトリの所有者とグループを apache に変更する chown -R apache:apache ./REPOSITORY.git     # ディレクトリの所有者とグループを apache に変更する
  
行 470: 行 466:
  
 <code> <code>
-cd /var/git                  # リポジトリのルートディレクトリに移動する +cd /var/git               共有リポジトリのルートディレクトリに移動する 
-htpasswd -c .htpasswd USER   # 新しいユーザ(例:USER)を作成する +htpasswd .htpasswd USER   # 新しいユーザ(例:USER)を作成する 
-New password:                # パスワードの入力 +New password:             # パスワードの入力 
-Re-type new password:        # (再入力)+Re-type new password:     # (再入力)
 </code> </code>
  
行 481: 行 477:
 git clone http://192.168.1.100/git/REPOSITORY.git  # Smart HTTPによる接続(Read/Write) git clone http://192.168.1.100/git/REPOSITORY.git  # Smart HTTPによる接続(Read/Write)
 git clone git://192.168.1.100/REPOSITORY.git       # Gitプロトコルによる接続(Read Only) git clone git://192.168.1.100/REPOSITORY.git       # Gitプロトコルによる接続(Read Only)
 +</code>
 +
 +{{fa>question-circle}}共有リポジトリを削除する
 +
 +<code>
 +cd /var/git                 # 共有リポジトリのルートディレクトリに移動する
 +rm -rf ./REPOSITORY.git     # リポジトリのディレクトリを削除する
 </code> </code>
  
 \\ \\
  
git2/server.1591278847.txt.gz · 最終更新: 2020/06/04 22:54 by y2sunlight