linux 安装GIT

3 篇文章 0 订阅

转载地址:https://blog.csdn.net/qq_31059985/article/details/80606882

服务器 CentOS7 + git version 1.8.3.1
客户端 Windows7 + git version 2.17.1.windows.2

服务器端安装和配置

安装Git服务器端

yum install git

安装完后,查看 Git 版本

[root@iZm5egstry6atum2bewjdgZ ~]# git --version
git version 1.8.3.1

创建服务器端git仓库,这里仓库设置为:/usr/local/gitrepository

 

[root@iZm5egstry6atum2bewjdgZ local]# mkdir -p /usr/local/gitrepository
[root@iZm5egstry6atum2bewjdgZ local]# cd /usr/local/gitrepository

[root@iZm5egstry6atum2bewjdgZ gitrepository]# git init --bare /usr/local/gitrepository
Initialized empty Git repository in /usr/local/gitrepository/

服务器端创建 git 用户,用来管理 Git 服务,并为 git 用户设置密码,

 

[root@iZm5egstry6atum2bewjdgZ gitrepository]# id git
id: git: no such user
[root@iZm5egstry6atum2bewjdgZ gitrepository]# useradd git
[root@iZm5egstry6atum2bewjdgZ gitrepository]# passwd git
Changing password for user git.
New password: 627woaini
BAD PASSWORD: The password contains the user name in some form
Retype new password: 627woaini
passwd: all authentication tokens updated successfully.

 

 

然后把 Git 仓库的所有者修改为 git用户

 
[root@iZm5egstry6atum2bewjdgZ gitrepository]# cd ..
[root@iZm5egstry6atum2bewjdgZ local]# chown -R git:git gitrepository/

 

客户端安装和配置

下载 Git for Windows,地址:https://git-for-windows.github.io/

一路next安装完之后,创建一个git本地存放地址,如:Z:\gittest 进入Z:\gittest 右键 Git Bash 打开命令行客户端。

安装完之后,查看 Git 版本

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值