How can I show the name of branches in `git log`?

前端 未结 3 851
鱼传尺愫
鱼传尺愫 2020-12-04 05:04

How can I show the name of branches in the output of git log?

For example with, git log --graph --all I get a nice overview of the commits,

3条回答
  •  醉梦人生
    2020-12-04 05:40

    I was looking for something similar to this - but wanted to know what branch a change was made. Hopefully this answer will be of use to others also.

    I'm investigating a risk with blackbox encryption, where a repo and it's branches/tags may become unavailable to current admins when enough users leave a project and the keyrings directory has not been religiously based off of master)

    I found that the answer below was helpful where the keyrings directory was not updated from master...

    Basically adding --source was what I needed to show the branches/tags. Adding --name-only will also show which file was actually changed.

    cd /path/to/repo-that-uses-blackbox-encryption
    git log --graph --all --decorate --source --name-only keyrings
    

    Another useful answer: How to show git log with branch name

提交回复
热议问题