Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ariyuan/34e60a5560c0e7640eea34eb832de57e to your computer and use it in GitHub Desktop.
Save ariyuan/34e60a5560c0e7640eea34eb832de57e to your computer and use it in GitHub Desktop.
Export to csv format the list of remote branches and their "owners"
for i in `git branch -a |grep remotes |awk '{print $1}' | cut -d"/" -f 3,4,5 |grep -v ^master$ |grep -v ^HEAD$`; do echo "`git log -1 --pretty=format:\"%an (%ae)\" origin/$i`|$i"; done |sort > /tmp/branches.csv
@ariyuan
Copy link
Author

ariyuan commented Apr 15, 2022

for i in git branch -a |grep remotes |awk '{print $1}' | cut -d"/" -f 3,4,5,6,7,8,9 |grep -v ^master$ |grep -v ^HEAD$; do echo "git log -1 --pretty='format:%an (%ae) | %cs | %s' --date=human origin/$i|$i"; done |sort > branches.csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment