1,從官網下載安裝包:gitg官網 進行安裝
2,配置git環境:
git config --global user.name "Your Name"
git config --global user.email "Your Email"
3,生成 SSH Key:
ssh-keygen -t rsa -b 4096 -C "Your Email"
4,查看生成的 SSH Key:
cat ~/.ssh/id_rsa.pub
5,將公鑰添加到 GitHub/GitLab:
GitHub:登錄 GitHub,點擊右上角頭像 > Settings > SSH and GPG keys。粘貼 id_rsa.pub 的內容添加進去;
GitLab:登錄 GitLab,點擊右上角頭像 > Preferences > SSH Keys。粘貼 id_rsa.pub 的內容添加進去。