git - 如何在cygwin上获取带有颜色和分页的git日志?

标签 git logging cygwin

我想在 cygwin 上使用带分页的彩色 git 日志。

我设法得到彩色原木

git log --color=always

如果我这样做

git log --color=always | less

我得到了分页,但是颜色命令被打印而不是解释

ESC[33mcommit b4dbe28f459adf0df1784d3a597628cc27abf836ESC[m
Author: Ernst Pluess <mail@address.com>
Date:   Thu Apr 18 13:23:07 2013 +0200

    Changed to UTF-8

在我的 OSX 盒子上,颜色和分页是 git log 在 shell 上的默认行为。我怎样才能在 Windows 上为 cygwin 获得相同的内容。

最佳答案

我能够通过运行全局配置 git(至少在 cygwin 上)

git config --global core.pager 'C:/cygwin64/bin/less.exe'

以这种方式运行 git log 会显示分页和彩色输出。

关于git - 如何在cygwin上获取带有颜色和分页的git日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16083056/

相关文章:

git - `ssh -T` 到 VSTS(Azure Devops) 验证成功,但 `git clone` 失败

Python 日志文件配置 KeyError : 'formatters'

cygwin - 如何修复 Windows 上的 "could not compile dependency :bcrypt_elixir"错误?

eclipse - Git check out 多个同名文件

git - Maven 和 Gitlab : release:prepare uses the wrong SCM URL

java - 为什么 java.util.logging.Logger 打印到 stderr?

python - 使用 f 字符串样式格式规范记录 float (特别是 "msecs")时防止舍入(或至少长度溢出)

c - execinfo.h : No such file or directory while installing VIC5. 0.1 在 Windows 上使用 cygwin

apache - Cygwin下的apache2中的连接错误

git - 是否可以跳过暂存区并(也)将未跟踪的新文件提交给 git?