我经常使用名为 console2 的Windows控制台,最近发现 PowerCmd ,所以我一直在尝试。
我创建一个Git存储库并进行三次更改。首先正确登录 console2 :
c:\code\junk>git log --pretty=oneline
015cfbec12208d7b719d523c92d0c46b726d42e6 third time lucky.
c8a9ffeb4381cd515a62937a0a50b7dc5360dbb8 Second commit
370e9cbb72feca9fb784843154f2171fefe2c656 initial commit
我使用 PowerCmd :
获得双倍的善意C:\code\junk>git log --pretty=oneline
[33m015cfbec12208d7b719d523c92d0c46b726d42e6[m third time lucky.
[33mc8a9ffeb4381cd515a62937a0a50b7dc5360dbb8[m Second commit
[33m370e9cbb72feca9fb784843154f2171fefe2c656[m initial commit
015cfbec12208d7b719d523c92d0c46b726d42e6 third time lucky.
c8a9ffeb4381cd515a62937a0a50b7dc5360dbb8 Second commit
370e9cbb72feca9fb784843154f2171fefe2c656 initial commit
任何人都知道什么事了吗?
编辑: 尝试了一个建议 - 无色和....
C:\code\junk>git log --pretty=oneline --no-color
015cfbec12208d7b719d523c92d0c46b726d42e6 third time lucky.
c8a9ffeb4381cd515a62937a0a50b7dc5360dbb8 Second commit
370e9cbb72feca9fb784843154f2171fefe2c656 initial commit
015cfbec12208d7b719d523c92d0c46b726d42e6 third time lucky.
c8a9ffeb4381cd515a62937a0a50b7dc5360dbb8 Second commit
370e9cbb72feca9fb784843154f2171fefe2c656 initial commit
太搞笑了!我喜欢PowerCmd,也许不喜欢git。
答案 0 :(得分:2)
这些是ANSI escape sequence(适用于ANSI colors),而PowerCmd似乎并不支持它们(如上所述in this thread)
您可以尝试:
git log --no-color
当你要求没有颜色时,这将允许你检查是否仍有重复的提交。
我检查过:即使我设置了TERM=msys
我让它表现的唯一方法是将stdout重定向到虚拟文本(not NUL
,但是实际的虚拟文件)
C:\Users\vonc\prog\git\git>git log -2 --no-color --oneline >dummy
f82887f Git 2.1-rc2
764c739 Merge branch 'mb/relnotes-2.1'