Git图形日志不工作



我对git很陌生,我正试图用下面的代码从git中的一个给定示例创建一个图形日志:

git config --global alias.graphlog log --graph --full-history --all --color  --pretty=format:'%x1b[33m%h%x09%C(blue)(%ar)%C(reset)%x09%x1b[32m%d%x1b[0m%x20%s%x20%C(dim white)-%x20%an%C(reset)'

目前我还没有理解示例中所有给定的参数。是数字设置问题还是示例代码有问题?

您尝试在这里做两件事:-编辑配置文件-显示日志

如果你只是尝试你的命令来查看日志,它工作得很好:

git log --graph --full-history --all --color --pretty=format:'%x1b[33m%h%x09%C(blue)(%ar)%C(reset)%x09%x1b[32m%d%x1b[0m%x20%s%x20%C(dim white)-%x20%an%C(reset)'

然后要使用别名git graphlog,您应该执行以下操作:

git config --global alias.graphlog '!git log --graph --full-history --all --color --pretty=format:"%x1b[33m%h%x09%C(blue)(%ar)%C(reset)%x09%x1b[32m%d%x1b[0m%x20%s%x20%C(dim white)-%x20%an%C(reset)"'

这将把命令git graphlog添加到您的配置文件.gitconfig中,但在您的示例中,您缺少引号和!在git之前,我还必须删除您命令中间的\。

最新更新