windows上傳本地專案至linux伺服器中的gitlab
1、安裝git: https://git-scm.com/downloads
linux伺服器中安裝gitlab: https://blog.csdn.net/JJBOOM425/article/details/83997541
2、新建工程
a、步驟一
b、步驟二
3、建立金鑰
a、桌面右鍵
b、cd ~/.ssh/
如果提示 “ No such file or directory”,你可以手動的建立一個 .ssh資料夾即可
mkdir ~/.ssh
c、配置全域性的name和email,參照你建立的工程Git global setup
git config --global user.name "椰子"
git config --global user.email "
d、生成key
ssh-keygen -t rsa -C "[email protected]"
e、最後生成兩個檔案:id_rsa和id_rsa.pub
f、把id_rsa.pub裡的內容貼上到gitlab金鑰中
g、金鑰建立成功
4、上傳專案
a、右鍵要上傳的專案,選擇Git Bash Here
b、輸入下面的命令
git config --global user.name "椰子"
git config --global user.email "[email protected]"
git init
git remote add origin ssh://[email protected]:10022/tyshawn/sdap1.git
git add .
git commit -m "程式原始碼"
git push -u origin master
參考建立的工程頁面:
c、專案上傳成功
原文轉自:https://blog.csdn.net/litianxiang_kaola/article/details/74075151