Because you used -2呀,然后合并来的上游修改比你的新,所以你自己的修改排在前2之外了。不要用-2, check the complete history, find the version you want to restore, check it out and then commit.
After seeing this interface, I still recommend tig
My clone 了你的库,然后我分别 checkout 到你之前的 commit 上然后创建新的分支,再进行 diff operation, here are the results:
Modification history from fix typo and translation 到 Merge...无 modules.rst
Modification history from add... 到 fix typo and translation 仍然无 modules.rst
Modification history from fix typo 到 add... 终于出现了 modules.rst
So it’s obvious git 的 log 记录没有错,你最近的几次 commit 并没有修改 modules.rst 文件,它又怎么会出现在 log Where is it?
The last four commit records:
According to the results of git diff, it can be determined that the submission from fix typo to add... is for modules. rst's most recent operation, so checking the log of modules.rst will definitely only show add... this time. git diff 的结果,可以确定从 fix typo 到 add... 的这次提交中是对 modules.rst 最近的操作,所以查看 modules.rst 的 log 肯定只显示到 add... 这次 commit
Enter the git log --merges command to display the
for merge: git log --merges 命令,显示用于 merge 的 commit
Did you find it? Compared with the previous merge, your merge has a conflict this time, and this conflict is different from your The problem file modules.rst is still related, so I analyzed that this should be the problem. It should be that your files conflicted, but you did not resolve the conflict, and merge succeeded , these conflicts are ignored for unknown reasons, so they will not be entered into the history of log as part of
. Okay, it's time to take a rest. I hope the answer will be helpful to the questioner. :)merge 相比,你这次 merge 是存在 conflict 的,而且这个 conflict 和你的问题文件 modules.rst 还有关,所以我分析这应该就是问题所在,应该是你的文件产生了冲突,但是你没有解决冲突,而又 merge 成功,这些冲突不知道什么原因被忽略,所以它们不会作为 commit 的一部分进入 log
Because you used
-2
呀,然后合并来的上游修改比你的新,所以你自己的修改排在前2之外了。不要用-2
, check the complete history, find the version you want to restore, check it out and then commit.Install git extras, then execute git revert, it will handle everything for you
Try it
git log --pretty=oneline modules.rst
After seeing this interface, I still recommend tig
My
clone
了你的库,然后我分别checkout
到你之前的commit
上然后创建新的分支,再进行diff
operation, here are the results:Modification history from
fix typo and translation
到Merge...
无modules.rst
Modification history from
add...
到fix typo and translation
仍然无modules.rst
Modification history from
fix typo
到add...
终于出现了modules.rst
So it’s obvious
git
的log
记录没有错,你最近的几次commit
并没有修改modules.rst
文件,它又怎么会出现在log
Where is it?The last four
commit
records:According to the results of
Enter thegit diff
, it can be determined that the submission fromfix typo
toadd...
is formodules. rst
's most recent operation, so checking thelog
ofmodules.rst
will definitely only showadd...
this time.git diff
的结果,可以确定从fix typo
到add...
的这次提交中是对modules.rst
最近的操作,所以查看modules.rst
的log
肯定只显示到add...
这次commit
git log --merges
command to display thefor
merge
:git log --merges
命令,显示用于merge
的commit
merge
, yourmerge
has aconflict
this time, and thisconflict
is different from your The problem filemodules.rst
is still related, so I analyzed that this should be the problem. It should be that your files conflicted, but you did not resolve the conflict, andmerge
succeeded , these conflicts are ignored for unknown reasons, so they will not be entered into the history oflog
as part of. Okay, it's time to take a rest. I hope the answer will be helpful to the questioner. :)
merge
相比,你这次merge
是存在conflict
的,而且这个conflict
和你的问题文件modules.rst
还有关,所以我分析这应该就是问题所在,应该是你的文件产生了冲突,但是你没有解决冲突,而又merge
成功,这些冲突不知道什么原因被忽略,所以它们不会作为commit
的一部分进入log