虚拟机安装的
[root@localhost ~]# yum -y install git
(之前搭建的是阿里云的yum源)
git版本:
[root@localhost ~]# git --version
git version 1.8.3.1
服务器端创建 git 用户,用来管理 Git 服务,并为 git 用户设置密码
[root@localhost ~]# cd /home/
[root@localhost home]# ls
[root@localhost home]# id git
id: git: no such user (提示没有这个用户)
[root@localhost home]# useradd git
[root@localhost home]# passwd git
更改用户 git 的密码 。
新的 密码:
无效的密码: 密码少于 8 个字符
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
[root@localhost home]# mkdir -p ./git/repository/gittest.git
[root@localhost home]# ls
git
[root@localhost home]# cd git
[root@localhost git]# ls
repository
[root@localhost git]# cd repository/
[root@localhost repository]# ls
gittest.git
这步很重要,初始化项目测试目录
[root@localhost repository]# git init --bare ./gittest.git
初始化空的 Git 版本库于 /home/git/repository/gittest.git/
然后把 Git 仓库的 owner 修改为 git
[root@localhost repository]# ll
总用量 0
drwxr-xr-x 7 root root 119 12月 11 19:04 gittest.git
#查看gittest.git项目文件夹的拥有者 #拥有者是root用户名
[root@localhost repository]# cd …
[root@localhost git]# ls
repository
[root@localhost git]# chown -R git:git repository #将拥有者改为git用户
[root@localhost git]# ll #再次查看gittest.git项目文件夹的拥有者
总用量 0
drwxr-xr-x 3 git git 25 12月 11 19:02 repository #拥有者是git用户
服务端就基本安装结束了,现在是要进行客户端的安装
windows 安装
下载地址: https://gitforwindows.org/
liunx系统下安装服务端具体的操作是可以参考 :https://www.linuxidc.com/Linux/2017-12/149803.htm
windows系统下安装客户端的具体操作是可以参考 :
https://blog.youkuaiyun.com/ytx2014214081/article/details/74556144