git服務器筆記

1、創建服務器和倉庫

#pkg install git //安裝git
#adduser git    //創建用戶git             
#git init --bare sample.git  //初始化sample.git倉庫
#chown -R git:git sample.git   //修改sample.git目錄的owner

2、客戶端機器創建SSH KEY,生成id_rsaid_rsa.pub兩個文件

#ssh-keygen -t rsa -C "[email protected]"

3、將id_rsa.pub文件的內容拷貝到git服務器/home/git/.ssh/authorized_keys

文件裏,一行一個。

4、客戶端測試連接:

#git clone git@server:/srv/sample.git
Cloning into 'sample'...
warning: You appear to have cloned an empty repository.


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