Linux下搭建Git服务器

① 安装 Git
 Linux 做为服务器端系统,Windows 作为客户端系统,分别安装 Git
 服务器端:
 yum install -y git
 安装完后,查看 Git 版本
 [root@localhost ~]# git --version
 git version 1.7.1

 ② 服务器端创建 git 用户,用来管理 Git 服务,并为 git 用户设置密码
 [root@localhost home]# id git
 id: git:无此用户
 [root@localhost home]# useradd git
 [root@localhost home]# passwd git

 ③ 服务器端创建 Git 仓库
 设置 /home/data/git/gittest.git 为 Git 仓库
 然后把 Git 仓库的 owner 修改为 git
 [root@localhost home]# mkdir -p data/git/gittest.git
 [root@localhost home]# git init --bare data/git/gittest.git
 Initialized empty Git repository in /home/data/git/gittest.git/
 [root@localhost home]# cd data/git/
 [root@localhost git]# chown -R git:git gittest.git/

 ④ 客户端 clone 远程仓库
 $ git clone git@192.168.56.101:/home/data/gittest.git

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值