1. 程式人生 > >git 免密提交

git 免密提交

免密提交

  • 1 生成公鑰對

    cd   #回到家目錄
    ssh-keygen -t rsa -C "自己的郵箱"
    id_rsa 私鑰  id_rsa.pub 公鑰

     

  • 2 將公鑰新增到碼雲伺服器上

    複製id_rsa.pub的內容
    碼雲 ----> 個人設定-->ssh公鑰,將複製的內容黏貼到“公鑰內容”中
    選中永久有效
    新增
  • 3.測試連線

    ssh -T [email protected]
    ​
    The authenticity of host 'git.coding.net (118.25.166.124)' can't be established.
    RSA key fingerprint is SHA256:jok3FH7q5LJ6qvE7iPNehBgXRw51ErE77S0Dn+Vg/Ik.
    Are you sure you want to continue connecting (yes/no)? yes          
    Warning: Permanently added 'git.coding.net' (RSA) to the list of known hosts.
    Coding 提示: Hello maobaobao, You've connected to Coding.net via SSH. This is a deploy key.
    maobaobao,你好,你已經通過 SSH 協議認證 Coding.net 服務,這是一個部署公鑰
    
    

     

  • 4 使用專案的ssh地址,可以clone或init/remote add