git上傳代碼至gitee倉庫


本文借鑒 @sclibingqing 文章:https://blog.csdn.net/sclibingqing/article/details/81179470

1.第一次上傳項目至gitee倉庫

2.gitee倉庫fork的項目(第二種方式暫無例子)

 

初次使用步驟如下(第一種方式):

1)進入需要上傳的項目文件夾

2)右鍵選擇Git Bash Here

3)命令窗口如下處理:

git config --global user.name "xxxx"
git config --global user.email "xxxx@xx.com"

git init
git add .
git commit -m "提交說明“
git remote add origin  https://gitee.com/your gitee user name/your project name.git
git push origin master

在執行命令 git push origin master 后若報錯則執行如下命令

  git pull origin master --allow-unrelated-histories

具體命令窗口截圖如下:

 注:若上面未能實現代碼上傳gitee,則使用如下命令:git push -f origin master (這個命令在團隊開發的時候最好不要用,可能會有生命危險


免責聲明!

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



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