Skip to content

Instantly share code, notes, and snippets.

@luisbosque
Created August 26, 2015 11:06
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save luisbosque/5513fa88b5087434089d to your computer and use it in GitHub Desktop.
Save luisbosque/5513fa88b5087434089d 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
@afsalahammed-okta
Copy link

afsalahammed-okta commented Oct 3, 2020

Getting exception like below, Any help is appreciated

Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'

@ariyuan
Copy link

ariyuan commented Apr 15, 2022

Getting exception like below, Any help is appreciated

Use '--' to separate paths from revisions, like this: 'git [...] -- [...]'

Try add more column number to the command:

cut -d"/" -f 3,4,5,6,7,8

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