Warning: Trying to access array offset on value of type bool in /home/koheizi/everything-beginner.com/public_html/programmer/wp-content/themes/luxeritas/inc/json-ld.php on line 114

git serverを自前で立ててやるぜ(無謀だな)

2014年3月4日

GW第一弾が始まる前夜、無謀にもgit serverを立てることに挑戦した。

# yum install git git-daemon git-all
# cd /var/lib/git/
# mkdir public_git
# cd public_git
# mkdir dotfiles.git
# cd dotfiles.git
# git --bare init --shared
Initialized empty shared Git repository in /var/lib/git/public_git/dotfiles.git/
# ls
branches  config  description  HEAD  hooks  info  objects  refs
# groupadd git
# usermod -G git poorman
# chown -R root:git .
# ls -ltr
total 32
drwxrwsr-x 4 root git 4096 Apr  6 20:39 refs
drwxrwsr-x 2 root git 4096 Apr  6 20:39 hooks
-rw-rw-r-- 1 root git   73 Apr  6 20:39 description
drwxrwsr-x 2 root git 4096 Apr  6 20:39 branches
drwxrwsr-x 2 root git 4096 Apr  6 20:39 info
-rw-rw-r-- 1 root git   23 Apr  6 20:39 HEAD
drwxrwsr-x 4 root git 4096 Apr  6 20:39 objects
-rw-rw-r-- 1 root git  126 Apr  6 20:39 config
#

Clientの作業に映る

$ git remote add origin ssh://xxxx@xxxx.myvps.jp/var/lib/git/public_git/dotfiles.git
$ git push origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 11.66 KiB, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://xxxx@xxxx.myvps.jp/var/lib/git/public_git/dotfiles.git
* [new branch]      master -> master

Serverで確認

# git log --stat
commit 6f27056acee188afae0bd2abe3fc399a0e033ff1
Author: xxxx@xxxxx
Date:   Sat Apr 6 21:22:43 2013 +0900
first commit
.vimrc | 1001 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1001 insertions(+), 0 deletions(-)

おおお、やれば出来るじゃないか。
って別に以下のサイト見てパクっただけです。
最底辺にこんな複雑なものを出来るわけ無いです。
http://www.mk-mode.com/octopress/2012/12/07/centos-construct-git-server/
ありがたや、ありがたや。

Linux

Posted by koheizi