git - 从特定分支执行 git pull 后无法推送
问题描述
我之前没有与其他使用 github 的人合作过,所以有点混乱,他们给了我一个分支来推送。这是我推送代码的方法,
git add .
git commit -m "Update layout, add chat app"
69 files changed, 6657 insertions(+), 228 deletions(-)
git remote add origin https://github.com
git push -u origin myBranch
然后它说
error: src refspec myBranch does not match any
error: failed to push some refs to 'https://github.com/boryio/everytalk-app.git'
所以我尝试了stackoverflow的几种解决方案,我找到了这个解决方案。
git push -f origin myBranch
* branch myBranch -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Update layout, add chat app
然后我尝试了这个
git pull --rebase origin myBranch
* branch myBranch -> FETCH_HEAD
Created autostash: 1eb65d7
Current branch kepha is up to date.
Applied autostash.
但是我在github上的代码没有改变,知道如何解决这个问题吗?
编辑
我不知道这是不是一个错误
git push -f origin myBranch
* branch myBranch -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Update layout, add chat app
就像你们说的那样
git pull origin myBranch
* branch myBranch -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Update layout, add chat app
在这种状态下我该怎么办?
解决方案
这不可能是您运行并得到的:
git push -f origin myBranch * branch myBranch -> FETCH_HEAD First, rewinding head to replay your work on top of it... Applying: Update layout, add chat app
因为您显示的输出是您从中获得的git pull
,而不是从git push
.
git push -u origin myBranch error: src refspec naonvl does not match any error: failed to push some refs to 'https://github.com/boryio/everytalk-app.git'
这也不符合。第一error
行表示您没有名为 的分支naonvl
。您的git push
命令指定了一个名为myBranch
.
这似乎naonvl
是一个错字:例如,您将其命名为 branch naoval
。解决方法是纠正您的错字。
(重要的是,在发布问题时,要非常小心,不要让其他人无法帮助您。请参阅我如何提出一个好的问题?)
推荐阅读
- node.js - SailsJS - 永远加载路线
- java - 以java语言导入父“UpTitle”类
- php - 在 Woocommerce 中隐藏只有 1 个变量的下拉菜单
- python - 分组熊猫系列的堆积条形图
- javascript - 无法使用 Node.js 将表单数据发送到 MongoDB 数据库
- r - R中的日期和时间减少
- azure - 使用 AAD 的多租户应用到应用授权
- rtos - BeagleBone Green 上的 QNX RTOS
- javascript - 如何从 HTML/Javascript 中的函数访问 URL?
- typescript - 有没有办法阻止 TypeScript 简化声明文件中的 `keyof` 语句?