git - 不能 "git bisect reset";无尽的 stash/重置循环

标签 git

平分后我想回到正常状态并恢复最新版本。

但是,git git bisect reset 提示某些具有本地更改的文件将被 check out 覆盖,我应该先存储

stash 并再次尝试重置提示一些不同的文件将被覆盖,我应该 stash 。 stash 那个让我回到第一个错误,依此类推。

git 存储; git bisect 重置

错误:文件 A、B 和 C 将被覆盖。请收藏

git 存储; git bisect 重置

错误:文件 D 将被覆盖。请收藏

git 存储; git bisect 重置

错误:文件 A、B 和 C 将被覆盖。请收藏

git 存储; git bisect 重置

错误:文件 D 将被覆盖。请收藏

等等。我想清除所有的二等分并返回到最新的提交。

有什么想法吗?

[完整成绩单]

   powerpro:source_build danny$ git stash ; git bisect reset
Saved working directory and index state WIP on (no branch): 01993b2 tsAnalysis changed to little Endian (htonl() etc)
HEAD is now at 01993b2 tsAnalysis changed to little Endian (htonl() etc)
error: Your local changes to the following files would be overwritten by checkout:
    src/ep/dtapiTsp/dtapibridge/include/DtCommon.h
    src/ep/dtapiTsp/dtapibridge/include/DtPortAsi.h
    src/ep/dtapiTsp/dtapibridge/src/DtPortAsi.cpp
Please, commit your changes or stash them before you can switch branches.
Aborting
Could not check out original HEAD '37c9eb1f56b0669b8382c1c3af68cfb73f6758b3'.
Try 'git bisect reset <commit>'.
powerpro:source_build danny$ git stash ; git bisect reset
Saved working directory and index state WIP on (no branch): 01993b2 tsAnalysis changed to little Endian (htonl() etc)
HEAD is now at 01993b2 tsAnalysis changed to little Endian (htonl() etc)
error: Your local changes to the following files would be overwritten by checkout:
    src/ep/dtapiTsp/DtapiBridge/src/DtPortAsi.cpp
Please, commit your changes or stash them before you can switch branches.
Aborting
Could not check out original HEAD '37c9eb1f56b0669b8382c1c3af68cfb73f6758b3'.
Try 'git bisect reset <commit>'.
powerpro:source_build danny$ git stash ; git bisect reset
Saved working directory and index state WIP on (no branch): 01993b2 tsAnalysis changed to little Endian (htonl() etc)
HEAD is now at 01993b2 tsAnalysis changed to little Endian (htonl() etc)
error: Your local changes to the following files would be overwritten by checkout:
    src/ep/dtapiTsp/dtapibridge/include/DtCommon.h
    src/ep/dtapiTsp/dtapibridge/include/DtPortAsi.h
    src/ep/dtapiTsp/dtapibridge/src/DtPortAsi.cpp
Please, commit your changes or stash them before you can switch branches.
Aborting
Could not check out original HEAD '37c9eb1f56b0669b8382c1c3af68cfb73f6758b3'.
Try 'git bisect reset <commit>'.
powerpro:source_build danny$ git stash ; git bisect reset
Saved working directory and index state WIP on (no branch): 01993b2 tsAnalysis changed to little Endian (htonl() etc)
HEAD is now at 01993b2 tsAnalysis changed to little Endian (htonl() etc)
error: Your local changes to the following files would be overwritten by checkout:
    src/ep/dtapiTsp/DtapiBridge/src/DtPortAsi.cpp
Please, commit your changes or stash them before you can switch branches.
Aborting
Could not check out original HEAD '37c9eb1f56b0669b8382c1c3af68cfb73f6758b3'.
Try 'git bisect reset <commit>'.

最佳答案

我认为问题在于您对之前的 HEAD(当您启动 bisect 时)和 bisect HEAD 的当前状态(可能是一些未跟踪的文件)进行了不兼容的更改).

你可以重置一切然后重新开始

git bisect reset HEAD    
git checkout your_branch --force
git reset HEAD --hard

然后,您应该使用 git status 检查是否有任何未跟踪的文件,如果有则解决它们。我敢打赌,您会找到一个现在存在的文件,但在之前的提交中被删除了。

关于git - 不能 "git bisect reset";无尽的 stash/重置循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34100170/

相关文章:

git - PhpStorm如何配置git推送到远程仓库?

ruby-on-rails - 如何在不泄露应用程序 key 和凭据的情况下开源我的 Rails 应用程序

android - 更改名称后提交类(class)

git - 这些 git 提交是如何复制到错误的分支中的?

javascript - Lerna Monorepo 将个人 git repos 保存为包

windows - Git diff 在路径中带有下划线的文件上失败

git:为什么在我执行 'git push' 之后我在 X 提交之前领先于 origin/master ?

c++ - 使用 cmake 从 github 中包含外部头文件库

git - 有什么方法可以在将功能分支重新设置为另一个分支后安全地删除它?

linux - Github,如何将我的分支同步到 master?