简体   繁体   English

更新被拒绝,因为您当前分支的尖端在后面...不正确

[英]Updates were rejected, because the tip of your current branch is behind… Not true

Updates were rejected, because the tip of your current branch is behind its remote counterpart. 更新被拒绝,因为当前分支的尖端在其远程对应的后面。

I know, how to resolve it, however, the subject of my question is different. 我知道,如何解决它,但是,我的问题的主题是不同的。

  1. I created two branches 我创建了两个分支
  2. I added one commit to each of them 我给每个添加了一个提交
  3. I pushed them into remote repository 我将它们推入远程存储库
  4. I rebased second-branch into first-branch 我将第二支公司重新划分为first-branch
  5. I pushed both branches to remote repository 我把两个分支都推到了远程仓库
  6. Success 成功

  1. I created two branches 我创建了两个分支
  2. I added one commit to each of them 我给每个添加了一个提交
  3. I pushed them into remote repository 我将它们推入远程存储库
  4. I rebased first-branch into second-branch 我将first-branch改为第二分支
  5. I pushed both branches to remote repository 我把两个分支都推到了远程仓库
  6. I got that error 我有那个错误

How come remote repository is ahead of me (I am behind), when I have 2 local commits and only 1 remote commit? 当我有2个本地提交而只有1个远程提交时,远程存储库又如何领先于我(我落后于我)?

What I am missing? 我缺少什么? Thank you. 谢谢。

EDIT: 编辑:

What does "I rebased into second-branch into first-branch" mean? “我从第二分支重新划分为第一分支”是什么意思? That you rebased second-branch onto the tip of first-branch? 您是否将第二分支重新定位到第一分支的顶端?

Sorry, I did not pay attention to my grammar for a while. 抱歉,我有一段时间没有注意我的语法。 I corrected it 我改正了


"I rebased second-branch into first-branch" means “我将第二分公司改成第一分公司”是指

git checkout first-branch git checkout第一分支

git rebase second-branch git rebase第二分支

After the first push your local and remote branches look like this: 第一次推送后,您的本地和远程分支如下所示:

first-branch   A
second-branch  B

After the rebase of first-branch onto second-branch, they look like this: 将第一个分支重新设置为第二个分支后,它们如下所示:

first-branch   B-A'
second-branch  B

When you attempt to push first-branch, your local branch is two commits ahead of the remote ( B and A' ) and the remote is one commit ahead of your local branch ( A ). 当您尝试推动第一分支时,本地分支比远程分支( BA' )提前两个提交,而远程分支比本地分支( A )提前一个提交。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 更新被拒绝,因为您当前分支的提示落后 - 但为什么? - Updates were rejected because the tip of your current branch is behind - but why? Git 更新被拒绝,因为您当前分支(主)的尖端在后面但是分支是最新的? - Git Updates were rejected because the tip of your current branch (main) is behind BUT branch is up to date? GitLab 更新被拒绝,因为您当前分支的尖端落后于其远程对应分支 - GitLab Updates were rejected because the tip of your current branch is behind its remote counterpart Gradle-release-plugin 更新被拒绝,因为您当前分支的尖端落后 - Gradle-release-plugin Updates were rejected because the tip of your current branch is behind 源树推送:提示:更新被拒绝,因为当前分支的尖端落后 - Source Tree Push : hint: Updates were rejected because the tip of your current branch is behind Github 错误“更新被拒绝,因为您当前分支的提示落后” - Github error "Updates were rejected because the tip of your current branch is behind" git:“更新被拒绝,因为您当前分支的尖端落后..”但是如何查看差异? - git: "Updates were rejected because the tip of your current branch is behind.." but how to see differences? 如何解决 git 错误:“更新被拒绝,因为您当前分支的提示落后了” - How to resolve git error: "Updates were rejected because the tip of your current branch is behind" 更新被拒绝,因为你当前分支的尖端落后于它的远程分支 - Updates were rejected because the tip of your current branch is behind its remote counterpart 收到错误“更新被拒绝,因为您当前分支的提示落后了” - Getting error “Updates were rejected because the tip of your current branch is behind”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM