简体   繁体   English

Git 更新被拒绝,因为您当前分支(主)的尖端在后面但是分支是最新的?

[英]Git Updates were rejected because the tip of your current branch (main) is behind BUT branch is up to date?

"The tip of your current branch is behind its remote counterpart" means that there have been changes on the remote branch that you don't have locally. “您当前分支的尖端位于其远程分支的后面”意味着远程分支上发生了您在本地没有的更改。 And Git tells you to import new changes from REMOTE and merge it with your code and then push it to remote. Git 会告诉你从 REMOTE 导入新的更改并将其与你的代码合并,然后将其推送到远程。

However, I have tried everything and get the message that everything is up to date但是,我已经尝试了一切,并得到了一切都是最新的信息

Though I am not able to do push to Heroku with an update anymore as I keep getting the message:虽然我无法再通过更新推送到 Heroku,因为我不断收到消息:

Git Updates were rejected because the tip of your current branch is behind Git 更新被拒绝,因为您当前分支的尖端落后

I tried git push --force origin main我试过 git push --force origin main

Tried pulling and merging尝试拉和合并

Even did a hard reset but absolutely nothing works and I need to deploy the API changes to Heroku but to no avail.甚至进行了硬重置,但绝对没有任何效果,我需要将 API 更改部署到 Heroku,但无济于事。 Can anyone help me get unstuck please?有人可以帮我解开吗?

Check if you have multiple remote repositories declared in your local project, with:检查您是否在本地项目中声明了多个远程存储库,其中:

git remote -v

And look at the graph of commits in order to visually see those remote commits that you might not have locally:并查看提交图,以便直观地查看您在本地可能没有的那些远程提交:

git log --decorate --graph --oneline --all --branches

That way, you will know which remote/branch you need to reset to.这样,您将知道需要重置到哪个远程/分支。

暂无
暂无

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

相关问题 更新被拒绝,因为您当前分支的提示落后 - 但为什么? - Updates were rejected because the tip of your current branch is behind - but why? 更新被拒绝,因为您当前分支的尖端在后面...不正确 - Updates were rejected, because the tip of your current branch is behind… Not true 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" Git 错误更新被拒绝,因为您当前分支的提示落后 - Git error Updates were rejected because the tip of your current branch is behind 如何解决git错误:重命名远程分支时“更新被拒绝,因为当前分支的提示落后” - How to resolve git error: “Updates were rejected because the tip of your current branch is behind” when renaming a remote branch 在'git filter-branch`之后无法推送到Heroku:更新被拒绝,因为当前分支的提示落后了 - Can't push to Heroku after a `git filter-branch`: Updates were rejected because the tip of your current branch is behind 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
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM