英文:
Git is showing duplicate "HEAD -> main, origin/main, origin/HEAD" when I type "git log"
问题
为什么我看到了两次 "HEAD -> main, origin/main, origin/HEAD" 的条目(我没执行 "git commit" 两次)?
还有那个 ":...skipping..." 行是什么意思?
我不知道如何解决这个问题,也不知道该尝试什么。
我已经谷歌搜索过,看看是否有人遇到过这个错误,但我没有在任何地方看到过。
英文:
Why am I seeing twice the entries of "HEAD -> main, origin/main, origin/HEAD" (I didn't "git commit" twice btw)?
And what that ":...skipping..." line means?
I don't know what to make of this so I don't know what to try.
I've googled to see if anyone has hit this error but I haven't seen it anywhere.
答案1
得分: 5
你只看到了两次。实际上,这是一个唯一的提交(相同的ID),它实际上只在git日志中列出了一次。
这是因为...
...跳过...
是通过滚动git log
的(默认)分页程序的输出,并另外使用终端的窗口/滚动缓冲区滚动回来的结果。
这是因为分页程序通过重写终端的屏幕内容来实现向上和向下滚动等操作。...跳过...
表示发生了这种情况,并且文件的内容没有按顺序显示。
如果你使用git log
,而不是使用终端滚动,而只使用
英文:
You're only seeing it twice. In reality it's a unique commit (same ID) and it was actually only listed once in the git log.
That's because...
...skipping...
is the result of scrolling through the output of git log
's (default) pager¹ and then additionally scrolling back up using the terminal's window/scrollback-buffer.
This is because the pager achieves scrolling up and down and such by rewriting the terminal's screen contents. The ...skipping...
indicates that this happened and that the contents of the file were not displayed in-sequence.
If you use git log
and don't scroll with your Terminal, but only with <Page Up> and <Page Down> you shouldn't see any duplicate commit.
¹ a pager is a command-line program that let's you navigate/scroll through a program's output
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论