在Eclipse上EGit:如何git push --force? [英] EGit on Eclipse: How to git push --force?

查看:1031
本文介绍了在Eclipse上EGit:如何git push --force?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,我的origin / branch与我的本地分支不同步,请参阅下面的



当我尝试从本地分段分支压入原点/ staging分支我得到了拒绝 - 非快进错误。

我在Windows PC上使用Eclipse和EGit模块。



另一篇文章我看到我可以通过git push --force origin staging来解决我的问题,以便用本地分支覆盖原始/暂存分支。



然而,我EGit没有看到这个选项,我不知道如何在EGit中打开一个控制台来做到这一点?



有谁知道我是否可以在EGit?



确定 - 修复了我自己的问题。看起来我有提交的问题没有被推回原点/分段。找到此处概述关于使用git reset XXX:没有--hard,它重置了分支标记,但保留了本地更改以供以后重新使用。



谢谢,Jason

解决方案

我刚刚遇到类似的问题,以下是我所做的:


  1. 团队 - >推送分行...

  2. 强制覆盖远程分支,如果它存在并已分歧


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:

  1. Team -> Push Branch...
  2. Force overwrite of branch on remote if it exists and has diverged

这篇关于在Eclipse上EGit:如何git push --force?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆