简体   繁体   中英

Get authors of git branch

I found this command, for listing all authors that contributed to a repository here :

git log --format='%aN' | sort -u

How can I find all authors that committed to a specific git branch? My goal is to have a readme.md in my repository that includes all authors that have committed to the master branch.

git log --format='%aN' <branchname> | sort -u

By default, you didn't specify the branchname, so it defaulted to HEAD, which points to your current branch. Just specify your branch name in this command to get what you want for each branch. Keep in mind that this will go from the branchName all the way back to the first commit, which may not be what you want (if the branch of interest was branched off some other branch, you might just want the branchPoint..branchName, to get the contributors for the new changes on that branch).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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