CentOS6.5 创建 Git server

2018-03-08 14:01:53 阅读:30 编辑

server:

useradd Git
passwd Git
yum install Git
usermod -s /bin/bash Git
su Git
cd ~
chown Git:Git /mnt/vdb1/Git
mkdir repo.git
cd repo.git
Git --bare init

client:

mkdir repo
cd repo
echo "hello world!" >>index.php
Git init
Git add .
Git commit -m "add index.php"
Git remote add origin Git@192.168.0.137:/home/Git/repo.git
//password:lin1...6
Git remote add origin Git@www.xmyunce.com:/mnt/vdb1/Git/test.git
Git push origin master