How to know which branch a “git log” commit belongs to?

前端 未结 3 611
北荒
北荒 2020-12-12 19:07

If I do git log, is there any parameter I could specify to be able to tell from the output which branch every commit belongs to?

Edit: to clarify, I und

3条回答
  •  一个人的身影
    2020-12-12 19:52

    Have you tried the "--decorate" option to git log?

    I have this alias in my .gitconfig:

    [alias]
            k = log --graph --oneline --abbrev-commit  --decorate
    

    It shows a similar graph as the one shown by gitk, with the branch names "decorated" besides the most recent commit in the branch.

提交回复
热议问题