VPS上にgitリポジトリを作ってみた

#構築環境

\# cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)

#Gitパッケージインストール

\# yum install git
Loaded plugins: fastestmirror
base                                                                        | 3.6 kB  00:00:00
extras                                                                      | 3.4 kB  00:00:00
updates                                                                     | 3.4 kB  00:00:00
vz-base                                                                     |  951 B  00:00:00
vz-updates                                                                  |  951 B  00:00:00
(1/4): base/7/x86_64/group_gz                                               | 157 kB  00:00:01
(2/4): extras/7/x86_64/primary_db                                           |  43 kB  00:00:01
(3/4): updates/7/x86_64/primary_db                                          | 6.0 MB  00:00:02
(4/4): base/7/x86_64/primary_db                                             | 4.9 MB  00:00:04
(1/2): vz-base/primary                                                      |  723 B  00:00:00
(2/2): vz-updates/primary                                                   |  157 B  00:00:00
Determining fastest mirrors
 * base: ftp.nara.wide.ad.jp
 * extras: ftp.nara.wide.ad.jp
 * updates: ftp.nara.wide.ad.jp
vz-base                                                                                        1/1
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-4.el7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-4.el7 for package: git-1.8.3.1-4.el7.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-4.el7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-4.el7.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-4.el7.x86_64
--> Processing Dependency: libgnome-keyring.so.0()(64bit) for package: git-1.8.3.1-4.el7.x86_64
--> Running transaction check
---> Package libgnome-keyring.x86_64 0:3.8.0-3.el7 will be installed
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-4.el7 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved


Package                     Arch              Version                       Repository       Size

Installing:
 git                         x86_64            1.8.3.1-4.el7                 base            4.3 M
Installing for dependencies:
 libgnome-keyring            x86_64            3.8.0-3.el7                   base            109 k
 perl-Error                  noarch            1:0.17020-2.el7               base             32 k
 perl-Git                    noarch            1.8.3.1-4.el7                 base             52 k
 perl-TermReadKey            x86_64            2.30-20.el7                   base             31 k

Transaction Summary

Install  1 Package (+4 Dependent packages)

Total download size: 4.5 M
Installed size: 22 M
Is this ok [y/d/N]:y
Downloading packages:
(1/5): libgnome-keyring-3.8.0-3.el7.x86_64.rpm                              | 109 kB  00:00:00
(2/5): perl-Error-0.17020-2.el7.noarch.rpm                                  |  32 kB  00:00:00
(3/5): perl-Git-1.8.3.1-4.el7.noarch.rpm                                    |  52 kB  00:00:00
(4/5): perl-TermReadKey-2.30-20.el7.x86_64.rpm                              |  31 kB  00:00:00
(5/5): git-1.8.3.1-4.el7.x86_64.rpm                                         | 4.3 MB  00:00:01


Total                                                              2.3 MB/s | 4.5 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:perl-Error-0.17020-2.el7.noarch                                               1/5
  Installing : perl-TermReadKey-2.30-20.el7.x86_64                                             2/5
  Installing : libgnome-keyring-3.8.0-3.el7.x86_64                                             3/5
  Installing : git-1.8.3.1-4.el7.x86_64                                                        4/5
  Installing : perl-Git-1.8.3.1-4.el7.noarch                                                   5/5
  Verifying  : perl-Git-1.8.3.1-4.el7.noarch                                                   1/5
  Verifying  : 1:perl-Error-0.17020-2.el7.noarch                                               2/5
  Verifying  : libgnome-keyring-3.8.0-3.el7.x86_64                                             3/5
  Verifying  : git-1.8.3.1-4.el7.x86_64                                                        4/5
  Verifying  : perl-TermReadKey-2.30-20.el7.x86_64                                             5/5

Installed:
  git.x86_64 0:1.8.3.1-4.el7

Dependency Installed:
  libgnome-keyring.x86_64 0:3.8.0-3.el7            perl-Error.noarch 1:0.17020-2.el7
  perl-Git.noarch 0:1.8.3.1-4.el7                  perl-TermReadKey.x86_64 0:2.30-20.el7

Complete!

# group作成

\# groupadd -g 1001 gitg

# user作成

\# useradd -g 1001 -u 1001 -d /home/gituser -m gituser

#リポジトリ作成

\# git init --bare --shared repos.git
Initialized empty shared Git repository in /root/repos.git/

\# chown -R gituser:gitg repos.git


まだgitちゃっと使ってないので、とりあえず構築まで。。。
もう少し理解が深まったら肉付けします。。。。