默认的LOG界面让人看着很不爽,那么怎样来配置一下LOG的显示?

从网上找到下面的命令可以满足我们的需求:

1 git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'--abbrev-commit

直接在终端运行一下可以看到效果

每次输入都很麻烦吧,那么为了一劳永逸,我们来配置一下:

1.打开gitconfig文件

1 open .gitconfig

2.配置gitconfig

在打开的文件中加入下面的命令:

1 [alias]
2  
3  lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

保存文件

3.查看配置后的log

1 git lg

4.在log中查看哪一行被修发了

1 git lg -p

相关文章:

  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2022-01-03
  • 2021-07-31
  • 2021-05-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2021-12-15
  • 2022-01-09
相关资源
相似解决方案