1.設置SSH
cd ~/.sh
sudo ssh-keygen -t rsa -C "你的註冊郵箱" #生成ssh
sudo gedit id_rsa.pub #打開id_rsa.pub文件
登錄到github打開設置;
選擇SSH and GPG keys,點New SSH,
然後配置SSH,點擊Add SSH key完成。
接下來測試配置是否成功
$ ssh -T git@github.com
如果出現以下內容即表示配置完成:
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
2.修改_config.yml
deploy:
type: git
repo: git@github.com:xxxx/xxxx.github.io.git
#格式必須是上述格式
branch: master
最後部署即可