本地新項目上傳到git


1. 進入某個要提交到git代碼工程根目錄 初始化成git倉庫

git init;

2. 添加所有代碼 到本地倉庫

git add .

3. 提交到本地倉庫

git commit -m 'first init project code'

4. 添加遠程倉庫的地址,(先在github網站上創建某個倉庫,記住遠程地址https或者ssh)

git remote add origin https://github.com/yourname/helloworld.git

5. 將遠程倉庫和本地倉庫合並統一

git pull --rebase origin master

執行改步驟可能會出現文件沖突,解決沖突后在執行git commit 提交

6. 將本地代碼推送到遠程分支

git push -u origin master

 


免責聲明!

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



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