git搭建

虛擬機安裝的
[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.csdn.net/ytx2014214081/article/details/74556144

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章