本地生成 ssh key


1. 配置Git用戶名和郵箱

  git config user.name "用戶名"

  git config user.email "郵箱"

 需要修改時

  git config --global user.name "用戶名"

  git config --global user.email "郵箱"

查詢 Git 本地配置

 git config --global -l  

 

2. 生成ssh key

    ssh-keygen -t rsa -C "郵箱"

如果報  fatal: not in a git directory, 是因為沒有將當前目錄作為git目錄。

先執行命令 git init 。再執行上面的

 

如果使用的是GitLab, 將 生成的id_rsa 復制到 settings 的ssh 中就可以了

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM