问题描述
我遇到了一个问题,我的origin / branch与我的本地分支不同步,请参阅下面的
当我尝试从本地分段分支压入原点/ staging分支我得到了拒绝 - 非快进错误。
我在Windows PC上使用Eclipse和EGit模块。
从我看到我可以通过git push --force origin staging来解决我的问题,以便用本地分支覆盖原始/暂存分支。
然而,我EGit没有看到这个选项,我不知道如何在EGit中打开一个控制台来做到这一点?
有谁知道我是否可以在EGit?
确定 - 修复了我自己的问题。看起来我有提交的问题没有被推回原点/分段。找到关于使用git reset XXX:没有--hard,它重置了分支标记,但保留了本地更改以供以后重新使用。
谢谢,Jason
我刚刚遇到类似的问题,以下是我所做的:
- 团队 - >推送分行...
- 强制覆盖远程分支,如果它存在并已分歧
I've run into a problem with my origin/branch being out of sync with my local branch, see below
When I try to PUSH from my local "staging" branch to the origin/staging branch I get the "rejected - non-fast-forward" error.
I use Eclipse with the EGit module on a windows PC.
From another post here I see that I can resolve my issue with the "git push --force origin staging" to over-ride the origin/staging branch with my local branch.
However, I don't see that option with EGit, and I don't see how to open a console in EGit to do this?
Does anyone know if I can do this within EGit?
OK - fixed my own issue. It appears I had issues with Commits that had not been Pushed back to origin/staging. Found an overview here on using the "git reset XXX : without --hard" which resets the branch marker, but keeps the local changes for later recommits.
Thanks, Jason
I have just come across a similar issue and here's what I did:
- Team -> Push Branch...
- Force overwrite of branch on remote if it exists and has diverged
这篇关于在Eclipse上EGit:如何git push --force?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!