前言
- 一般在gitlab等仓库里可以看见分支图,其实git上也有这个功能,只要配置别名快速调用就可以了。
git配置
- 首先你需要找到git配置文件。
- windows的git配置文件一般在用户目录下自己登陆名字的文件夹里有个.gitconfig文件。
- mac的git配置文件在~/.gitconfig里。
- 编辑文件复制以下alias:
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' -10 --all
配置效果
- 配置前的git log:
- 配置后git log:
文章来源地址https://www.toymoban.com/news/detail-613765.html
文章来源:https://www.toymoban.com/news/detail-613765.html
到了这里,关于【git】git配置自带的查看分支log图的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!