Last-modified: 2011-12-30 (金) 03:57:44
Git/Debianへのインストール(中央リポジトリ)

概要

中央管理用のリモートリポジトリサーバーをDebianで構築します。

手順

  1. Gitをインストールします。
    Everything is expanded.Everything is shortened.
      1
      2
    
     
     
    
    apt-get install git-core
    apt-get install git-daemon-run
  2. Gitユーザーを作成します。(以降「git」)
    Everything is expanded.Everything is shortened.
      1
    
     
    
    adduser git
  3. /etc/sv/git-daemon/runを編集します。
    Everything is expanded.Everything is shortened.
      1
      2
      3
      4
      5
      6
    
    -
    !
     
    -
    |
    !
    
    #!/bin/sh
    exec 2>&1
    echo 'git-daemon starting.'
    # Gitデーモン起動
    # リポジトリルートを変更
    exec git-daemon --verbose --base-path=/home/git --export-all --enable=receive-pack
  4. ユーザーをgitに切り替え、初期設定を行ないます。
    Everything is expanded.Everything is shortened.
      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
    
    -
    !
    -
    !
    -
    !
    -
    !
    -
    !
     
    -
    !
    
    # gitへ切り替え
    login git
    # 名前を設定
    git config --global user.name "git@hogeServer"
    # アドレス設定
    git config --global user.email "[email protected]"
    # 色設定
    git config --global color.ui auto
    # ページャ設定
    git config --global core.pager "lv -c"
     
    # 現在の設定確認(元ファイルは~.gitconfig)
    git config --list

検証時の環境

参考