Linux(Centos7.5)安装GIT

安装命令:

yum install -y git  

查看版本号:

git --version  

创建账户:

[root@localhost home]# id git  
id: git:无此用户  
[root@localhost home]# useradd git  
[root@localhost home]# passwd git  

创建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 /data/git/gittest.git/  
[root@localhost home]# cd /data/git/  
[root@localhost git]# chown -R git:git gittest.git/

克隆仓库:

地址:git@IP:/data/gittest.git

参考:https://www.cnblogs.com/dee0912/p/5815267.html

原文地址:https://www.cnblogs.com/DreamFather/p/11327712.html