简体   繁体   English

Git 带有分支名称的图形

[英]Git graph with branch name

I saw a lot of very nice git graphs like in this post: Pretty git branch graphs我在这篇文章中看到了很多非常漂亮的 git 图: Pretty git branch graphs

But there was never the branch name, in which the commit was done.但是从来没有完成提交的分支名称。 How can I add this?我怎样才能添加这个?

The --decorate flag adds branch names to git log . --decorate标志将分支名称添加到git log For example, without:例如,没有:

$ git log --oneline --graph
* 51ebf55b93 The sixth batch for 2.26
*   f97741f6e9 Merge branch 'es/outside-repo-errmsg-hints'
|\
| * e0020b2f82 prefix_path: show gitdir when arg is outside repo
* |   123538444f Merge branch 'jk/doc-credential-helper'
|\ \
| * | cc4f2eb828 doc: move credential helper info into gitcredentials(7)

With --decorate :随着--decorate

$ git log --oneline --graph --decorate
* 51ebf55b93 (HEAD -> master, origin/master, origin/HEAD) The sixth batch for 2.26
*   f97741f6e9 Merge branch 'es/outside-repo-errmsg-hints'
|\
| * e0020b2f82 (es/outside-repo-errmsg-hints) prefix_path: show gitdir when arg is outside repo
* |   123538444f Merge branch 'jk/doc-credential-helper'
|\ \
| * | cc4f2eb828 (jk/doc-credential-helper) doc: move credential helper info into gitcredentials(7)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM