git命令提交代碼至碼雲

首先運行git clone https://gitee.com/sunzhenzhen/order_meal.git
其次創建git倉庫 執行git init命令
將項目的全部文件添加到倉庫中(即將你所要變動的文件加入其中)執行git add .
若是想添加某個特定的文件,只需把.換成特定的文件名便可
爲你添加的文件添加信息 git commit -m "註釋"
將本地的倉庫關聯到github上  git remote add origin https://gitee.com/sunzhenzhen/order_meal.git
上傳以前,要先pull一下,執行以下命令: git pull origin master
最後一步,上傳代碼到碼雲 git push -u origin master
如果新建的項目出現以下問題:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com:qzmly100/repository-.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
則只須要強制更新便可,輸入以下命令:
git push origin master -f,強行讓本地分支覆蓋遠程分支

git status //查看今日須要上傳的
git add . //添加
git commit -m '活動內容' //註釋
git push -u origin members //分支
複製代碼
相關文章
相關標籤/搜索