Find out a Git branch creator

前端 未结 11 1391
陌清茗
陌清茗 2020-11-28 17:57

I want to find out who created a branch.

I am sort of able to do so with:

git branch -a | xargs -L 1 bash -c \'echo \"$1 `git log --pretty=format:\"%         


        
11条回答
  •  孤独总比滥情好
    2020-11-28 18:46

    I know this is not entirely the scope of the question, but if you find the need to filter only commits by a specific author, you can always pipe to grep :)

    # lists all commits in chronological order that
    # belong to the github account with
    # username `MY_GITHUB_USERNAME` (obviously you
    # would want to replace that with your github username,
    # or the username you are trying to filter by)
    
    
    git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' | sort -committerdate | grep 'MY_GITHUB_USERNAME'
    

    happy coding! :)

提交回复
热议问题