我这样做:
git log --all --format=format:'%C(bold blue)%h%C(reset) - %an%C(reset)%C(bold yellow)%d%C(reset) - %C(bold green)(%ad)%C(reset) %C(white)%s%C(reset) %C(bold white)'
正确的结果:
2c6f8b9 - Matheus - (Thu Sep 20 14:06:51 2012) ++ import clientes, ++ now send email ok!
102c911 - LIVE - (Thu Sep 20 13:25:24 2012) ++ db
93bf163 - Matheus - (Wed Sep 19 17:31:18 2012) ++ import clientes
8539cf4 - Matheus - (Wed Sep 19 16:41:56 2012) ++ import clientes, ++ now with defaultBilling and defaultShipping
843509a - Matheus - (Wed Sep 19 16:36:19 2012) ++ import clientes, ++ now with defaultBilling and defaultShipping
b8de06d - Matheus - (Wed Sep 19 15:48:05 2012) ++ import clients
到我的文件:
git log --all --format=format:'%C(bold blue)%h%C(reset) - %an%C(reset)%C(bold yellow)%d%C(reset) - %C(bold green)(%ad)%C(reset) %C(white)%s%C(reset) %C(bold white)' > file
保存在文件输出时的错误结果:
[1;34ma36b984[m - LIVE[m[1;33m[m - [1;32m(Thu Sep 20 16:16:57 2012 -0300)[m [37m++ import clientes, ok!![m [1;37m
[1;34m1794d80[m - Matheus[m[1;33m[m - [1;32m(Thu Sep 20 15:31:28 2012 -0300)[m [37mMerge remote-tracking branch 'live/master' into import-clientes[m [1;37m
[1;34me8a1735[m - LIVE[m[1;33m[m - [1;32m(Thu Sep 20 15:23:00 2012 -0300)[m [37m++ db[m [1;37m
[1;34m7c838ef[m - Matheus[m[1;33m[m - [1;32m(Thu Sep 20 15:00:52 2012 -0300)[m [37m++ import-clientes, external file[m [1;37m
[1;34m2c6f8b9[m - Matheus[m[1;33m[m - [1;32m(Thu Sep 20 14:06:51 2012 -0300)[m [37m++ import clientes, ++ now send email ok![m [1;37m
[1;34m102c911[m - LIVE[m[1;33m[m - [1;32m(Thu Sep 20 13:25:24 2012 -0300)[m [37m++ db[m [1;37m
[1;34m93bf163[m - Matheus[m[1;33m[m - [1;32m(Wed Sep 19 17:31:18 2012 -0300)[m [37m++ import clientes[m [1;37m
我尝试没有漂亮的格式,完美地工作。后来我尝试了漂亮的格式,不工作!
我如何以漂亮的格式将其保存在文件中?
谢谢。