天天看點

GitLab 公鑰設定 上傳項目

首先本地git項目檔案夾 打開 git bash

git執行初始化指令 git init

使用指令生成公鑰

ssh-keygen -t rsa -C ‘[email protected]’ 然後一路回車(-C 參數是你的郵箱位址)

GitLab 公鑰設定 上傳項目

找到提示公鑰私鑰生成的目錄

GitLab 公鑰設定 上傳項目

将 id_rsa.pub 裡的内容複制出來

gitlab 上設定公鑰

找到ssh設定頁面

GitLab 公鑰設定 上傳項目

粘貼進去點選add Key就可以了

GitLab 公鑰設定 上傳項目

上傳項目

先克隆項目到本地

GitLab 公鑰設定 上傳項目

本地git連接配接遠端倉庫

配置使用者

郵箱

git config --global user.email “[email protected]”

使用者名

git config --global user.name “Your Name”

連接配接參考

//如有遠端倉庫先删除

git remote rm origin

git remote add origin [email protected]:guoqun/byyl-web.git

git 建立忽略檔案

touch .gitignore

git add .gitignore

git push