https://www.cnblogs.com/gongyuhonglou/p/6922721.htmlhtml
$ ssh-keygen -t rsa -C 「郵箱」
按3個回車,密碼爲空。git
ssh-keygen
-t rsa -f ~/.ssh/id_rsa.sohu -C "email"上面的id_rsa.sohu
github
就是咱們指定的文件名,這時~/.ssh
目錄下會多出id_rsa.sohu
和id_rsa.sohu.pub
兩個文件,id_rsa.sohu.pub
裏保存的就是咱們要使用的key。web
config
文件config
文件若是config
文件不存在,先添加;存在則直接修改ssh
touch ~/.ssh/config
測試
config
文件裏添加以下內容Host github.com
IdentityFile /root/webhook/bin/keyfetch
測試:code
ssh -T git@github.comhtm
git操做blog
git pull 從遠程拉取最新版本 到本地 自動合併 merge git pull origin master
git fetch 從遠程獲取最新版本 到本地 不會自動合併 merge
git fetch origin master
git log -p master ../origin/master
git merge orgin/master