1. 程式人生 > >GitLab配置SSH Keys

GitLab配置SSH Keys

命令列

  • 開啟git bash, 輸入以下命令, 生成ssh公鑰和私鑰對, -C引數是郵箱地址

    ssh-keygen -t rsa -C 'your-email'
  • 開啟~/.ssh/id_rsa.pub檔案(~表示使用者目錄), 複製其中的內容.

  • 開啟gitlab網頁, 右上角頭像->Settings->左側欄SSH Keys
  • 把複製的id_rsa.pub檔案中的內容貼上到Key所對應的文字框,在Title對應的文字框中給這個sshkey設定一個名字,點選Add key按鈕, 完成.

GitKraken

右上角Setting -> Preferences -> Authentication -> 去掉Use local SSH agent勾選 -> Generate… 生成公鑰私鑰對, 剩餘的步驟請參考命令列.