平分后我想回到正常状态并恢复最新版本。
但是,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/