Git服务器搭建

Git服务器搭建

Git服务器可以搭建在windows,也可以搭建在Linux中,由于windows中copssh登录git服务器软件已经收费,免费版本有很多缺点。因此把git服务器搭建在Linux中。

 

依赖环境

Git需要很多依赖环境:因此安装git需要先安装下列软件:

[root@itcast-01 ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel gcc-c++

 

安装git

上传git安装包:

安装包:git-2.9.3.tar.gz

tar -xvf git-2.9.3.tar.gz

安装命令:(进入git解压目录)

[root@itcast-01 git-2.9.3]# make prefix=/usr/local all

[root@itcast-01 git-2.9.3]# make prefix=/usr/local install

 

创建git用户

添加Linux的用户,用户名为git的用户:

[root@itcast-01 ~]# useradd git

 

设置git用户的密码

[root@itcast-01 ~]# passwd git

 

切换到git用户

[root@itcast-01 ~]# su - git

 

初始化仓库

初始化仓库,仓库名为taotao.git:

[git@itcast-01 root]$ cd

[git@itcast-01 ~]$ git init --bare taotao.git

始化空的 Git 仓库于 /home/git/taotao.git/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值