2

我用很多不同的方式搜索了这个,找不到其他人在谈论它(至少据我所知)。

在我的办公室电脑上,我试图找到解决我遇到的问题的方法(所以我领先于我的远程 git repo,但没有提交)。那天晚上在家里,我想出了解决方案,并将其从我的家用电脑推送到我的远程仓库。

现在我回来工作了,我想在我的办公室电脑上重置我的本地仓库以匹配遥控器(并丢弃我所有的本地更改)。

我跑了:

git reset --hard origin/branch1

我有:

HEAD is now at 1501f25 **Still trying to merge**

这是什么意思?
' Still trying to merge' 似乎表明它没有以某种方式完成,但我看不出是如何完成的(而且我没有运气在 git 文档中找到明确的答案)。

4

1 回答 1

0

If a git merge --abort (git1.7.4+, January 2011) doesn't do it, check if you still have a .git/MERGE_HEAD file (and delete it).

Then the git reset should proceed (or, since it completed, the git repo state should be coherent).
Make sure you are in the right branch you wanted to reset to origin/branch1.


As the OP Roy Collings suggests, recloning should get rid of the warning, but that means having one's project config files versioned in order to minimize the time spent to configure everything again in a new cloned repo.
Since relative paths are supported in an Eclipse config, having .project and .classpath in a git repo is possible.

于 2013-07-15T07:12:31.157 回答