Git显示重复的“HEAD -> main, origin/main, origin/HEAD”当我输入“git log”。

huangapple go评论70阅读模式
英文:

Git is showing duplicate "HEAD -> main, origin/main, origin/HEAD" when I type "git log"

问题

Git显示重复的“HEAD -> main, origin/main, origin/HEAD”当我输入“git log”。

为什么我看到了两次 "HEAD -> main, origin/main, origin/HEAD" 的条目(我没执行 "git commit" 两次)?

还有那个 ":...skipping..." 行是什么意思?

我不知道如何解决这个问题,也不知道该尝试什么。

我已经谷歌搜索过,看看是否有人遇到过这个错误,但我没有在任何地方看到过。

英文:

Git显示重复的“HEAD -> main, origin/main, origin/HEAD”当我输入“git log”。

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

huangapple
  • 本文由 发表于 2023年3月23日 08:18:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/75818307.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定