git 服務(wù)器安裝
客戶端執(zhí)行
說明:記錄一下
useraddgityuminstallgit-coresugitmkdir/home/git/repositoriesgitinit--baremyprj
在任意一個客戶端執(zhí)行
如果沒有安裝git,可以先執(zhí)行yuminstallgit
設(shè)置客戶端的用戶名和email
gitconfig--globaluser.namename1gitconfig--globaluser.emailname1@example.com
初始化
mkdirinitial.commitcdinitial.commit/gitinitgitremoteaddorigingit@node2:/home/git/repositories/myprj/touchReadmegitadd.gitcommit-m"addReadme"
安裝完成
客戶端使用方法:
先配置ssh免密碼登陸
設(shè)置用戶名和email
gitconfig--globaluser.namename1gitconfig--globaluser.emailname1@example.com
然后在客戶端執(zhí)行
同步版本庫
gitclonegit@node2:/home/git/repositories/myprj/
提交本地文件到服務(wù)器上
touchtest1gitaddtest1gitcommit-m"addtest1"gitpush
下載服務(wù)器上的版本庫到本地
gitpull
配置ssh免登陸方法
在客戶端執(zhí)行
ssh-keygen然后一直回車
在服務(wù)器端執(zhí)行
mkdir-p/home/git/.ssh/touch/home/git/.ssh/authorized_keys
拷貝客戶端的公鑰到服務(wù)器端的authorized_keys中
客戶端公鑰位置:/home/name1/.ssh/id_rsa.pubname1為客戶端用戶名,將id_rsa.pub中的內(nèi)容寫入到authorized_keys中
chmod600authorized_keys
完成,測試方法sshgit@node2直接可以登陸
參考咨詢客服
Tags:客戶端執(zhí)行,git 服務(wù)器安裝
版權(quán)聲明:本站文章來源標注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學習參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。