1.輸入git push origin master
出錯:error: failed to push some refs to
那是由於本地沒有update到最新版本的項目(git上有README.md文件沒下載下來)
本地直接push因此會出錯。
2.因此本地要輸入git pull
而後出現的英語提示'git pull <repository> <refspec>'顯示要選擇遠程分支
2.就試試指定目標到遠程分支
輸入git pull origin
出現提示
but did not specify
a branch. Because this is not the default configured remote
for your current branch
3.,重置pull origin!
輸入git pull --rebase origin master
成功update到最新文件
4.輸入git push origin master
整個項目就上傳到coding雲了
5.仍是得多學英語才能再stackoverflow混
參考資料
git error: failed to push some refs to
See git-pull(1) for details
git pull <remote> <branch>
好比git pull origin master
從遠端origin拉取master分支的內容而後合併到當前所處的本地分支。直接git pull的話默認遠程庫是orgin,默認遠程庫的分支是master。
If you wish to set tracking information for this branch you can do so with:
指定遠程分支
git branch --set-upstream-to=origin/<branch> master
好比咱們設置遠程庫origin的master分支
git branch --set-upstream-to=origin/master
#【git】強制覆蓋本地代碼(與git遠程倉庫保持一致)