環境:
FreeBSD 10.3
Git 2.9.2
Step:
1. cd /usr/ports/devel/git ; make install clean
enable option:
CONTRIB, CURL, CVS, ICONV, NLS, P4, PCRE, PERL, SEND_EMAIL, SVN
2. setup /etc/rc.conf
git_daemon_enable="YES" git_daemon_directory="/path/of/git/repository" # 存放 git repository 的地方 git_daemon_flags="--verbose --export-all --syslog --reuseaddr --enable=receive-pack --base-path=/path/of/git/repository --detach" # 一些 git 的參數 |
3. backup at old server and remove to new server
@old server
cd /path/of/git tar cvfz /path/to/backup/folder/backupfile.tgz repository |
@new server
scp old-server-ip:/path/to/backup/folder/backupfile.tgz /path/of/git cd /path/of/git tar zxvf backupfile.tgz /usr/local/etc/rc.d/git_daemon restart |
要重頭建立 git server 的話, 參考這篇
3.1 簡化版
@ old server
cd /path/of/git tar cvfz - repository | ssh 'new server ip' "tar zxf - -C /path/of/git" |
Git Server 搬家 + 安裝步驟