Git 項目提交新倉庫


提示:進入項目文件操作

步驟:

1.git init   ----------初始化git倉庫

2.git remote add origin 你的項目地址  ------------------如:https://gitee.com/lh_resource /*** (鏈接新建倉庫)

   報錯:fatal: remote origin already exists   使用:git remote rm origin

3.git add .   -------------項目中所有文件保存到緩存

4.git commit -m '對上傳文件的注釋'  -------- 提交代碼

5.git push  -------- 提交到倉庫

如提交有問題:

git push origin master -f 表示舍棄線上的文件,強制推送

 

分支切換

1.git branch -a  ------------查看所有分支

2. git branch -----------查看當前分支

3.git checkout -b 分支名稱  分支路徑   --------------切換當前分支

 


免責聲明!

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



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