LoginSignup
1
0

More than 3 years have passed since last update.

WindowsでGit サーバーを建てる。

Last updated at Posted at 2021-01-29

需要が増えそうなので雑に書きます。

サーバー・クライアント共通

Git for Windowsをダウンロードします。

インストールはほぼデフォルトの設定で問題ないですが、
Configuring the line ending conversions に関しては

  • Checkout as-is, commit as-is

に設定してください。OSを跨ぐと改行文字が死にます。

サーバー側でGit の設定

<>内は適宜置き換えてください。
コンソールで以下のコマンドの実行

# ユーザー設定
git config --global user.email "<メールアドレス>"
git config --global user.name "<ユーザー名>"

# push 時にコンソールがハングするときは以下を設定
git config --global sendpack.sideband false

#Git デーモンの起動(外部接続用)
git daemon --verbose --export-all --base-path=<ファイルパス>
(--enable=receive-packをつけると認証無しでGitの操作ができる)

クライアント側でGit の設定

# ユーザー設定
git config --global user.email "<メールアドレス>"
git config --global user.name "<ユーザー名>"

# push 時にコンソールがハングするときは以下を設定
git config --global sendpack.sideband false

これで適当にサーバーにリポジトリを作って

git clone git://<サーバーIP>/<設定したファイルパス以下>

を実行すればクローンできると思います。
出来なかったら、ファイアウォールとウイルス対策ソフトのport : 9418(TCP)を確認してください。
許可していないと送受信できません。
追記:9418はGit protocolが使用するものなので、sshやhttpの人はしなくても問題ないです。

1
0
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
1
0