2017年12月14日 星期四

[ Git 常見問題 ] Git - list all authors of a folder of files?

Source From Here 
Question 
How can I list the author names of a particular folder that's versioned by git

I see that I can git blame a file and list the author of each line, but I can't do that for a folder, and I would also like only a unique list (each author listed only once

How-To 
Based on The shortest possible output from git log containing author and date, you can use command git log
// '%an': author name
// '%x00': print a byte from a hex code

# git log --pretty=format:"%an%x09" myfolder | sort | uniq


Supplement 
Git log pretty-formats

沒有留言:

張貼留言

[Linux 常見問題] How to set a file size limit for a directory?

Source From   Here   Question   I   have a directory on my system which is used for a specific reason by applications and users , but I   d...