【发布时间】:2015-08-13 12:48:37
【问题描述】:
当我通过管道将 git 命令发送到 head 以仅显示几十个提交时,颜色会丢失:
git log --oneline | head -50
如何保持有限行数的颜色?
【问题讨论】:
当我通过管道将 git 命令发送到 head 以仅显示几十个提交时,颜色会丢失:
git log --oneline | head -50
如何保持有限行数的颜色?
【问题讨论】:
-(n) 仅显示最后 n 次提交
参考:https://git-scm.com/book/no-nb/v1/Grunnleggende-Git-Viewing-the-Commit-History
例如
git log -50 --oneline
【讨论】:
Git 检测到您正在使用管道,因此它会禁用颜色,但您可以通过 --color 强制它使用颜色:
git log --graph --oneline --all --decorate --color | head -50
【讨论】:
在你的 git log 命令中使用 -50 作为参数怎么样?
它将显示最新的 50 个提交。
你也可以写
【讨论】: