git建立秘鑰

2021-08-17 16:15:37 字數 571 閱讀 5403

生成ssh秘鑰

$ git config --global user.name "luoyong"

$ git config --global user.email "[email protected]

"  ##填寫自己的郵箱

3、生成ssh金鑰

$ ssh-keygen -t rsa -c "[email protected]

" //直接按3次回車選擇無密碼

4、新增私鑰到ssh

$ eval $(ssh-agent -s) //開啟ssh-agent

$ ssh-add ~/.ssh/id_rsa //id_rsa為私鑰檔名,預設在使用者目錄下.ssh中

5、將公鑰新增到gitlab

profile settings->ssh keys ->add an ssh key

將~/.ssh/id_rsa.pub中內容新增到ssh keys中

6、測試

$ ssh [email protected]

git 檢視自己秘鑰 Git秘鑰問題

簡介 在管理git專案上,很多時候都是直接使用https url轉殖到本地,當然也有有些人使用ssh url轉殖到本地。這兩種方式的主要區別在於 使用https url轉殖對初學者來說會比較方便,複製https url然後到git bash裡面直接用clone命令轉殖到本地就好了,但是每次fetch...

Git秘鑰問題

在管理git專案上,很多時候都是直接使用https url轉殖到本地,當然也有有些人使用ssh url轉殖到本地。這兩種方式的主要區別在於 使用https url轉殖對初學者來說會比較方便,複製https url然後到git bash裡面直接用clone命令轉殖到本地就好了,但是每次fetch和pu...

git 生成秘鑰

cpp view plain copy permission denied publickey fatal the remote end hung up unexpectedly 應該是ssh key過期了吧 試著重新建立ssh key,按以下步驟 cpp view plain copy ssh k...