操作指南【密碼默認(rèn)為:git】
本地生成公鑰然后上傳至服務(wù)器
<!--會(huì)覆蓋別人的rsa,不建議使用-->
scp -p ~/.ssh/id_rsa.pub git@192.168.3.44:/home/git/.ssh/authorized_keys
<!-- 建議使用此方法 -->
ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
例如:ssh-copy-id -i ~/.ssh/id_rsa.pub git@192.168.3.44
clone到本地
git clone git@192.168.3.44:some-source.git
遠(yuǎn)程
git clone git@119.40.53.50:some-source.git
``
推送到遠(yuǎn)程
git push origin [branch名稱(chēng)]
關(guān)聯(lián)遠(yuǎn)程分支
git remote add origin git@ip.port:Library.git
合并
在分支上
git merge origin [branch名稱(chēng)]
在master
git merge [branch名稱(chēng)]
mac生成rsa
ssh-keygen -t rsa -C “您的郵箱地址”
cd ~/.ssh
open .
將公鑰傳至服務(wù)器 /home/git/.ssh/authorized_keys中