Skip to content

Instantly share code, notes, and snippets.

@peekg
Created April 11, 2016 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peekg/72b1081f88932b51b45c6f9669a5dfb5 to your computer and use it in GitHub Desktop.
Save peekg/72b1081f88932b51b45c6f9669a5dfb5 to your computer and use it in GitHub Desktop.
git - list remote branches with commit by $USER
#!/bin/bash
HEAD=origin
if [ -n "$1" ]; then
HEAD=$1
fi
CURRENT_IFS=$IFS
IFS=$'\n'
for C in $(git ls-remote --heads stash)
do
ID=$(echo $C | cut -f1 -d$'\t')
if [ $(git log -n 1 --pretty=format:"%an" $ID) = "$USER" ]; then
echo "$(echo $C | cut -f2 -d$'\t')"
fi
done
IFS=$CURRENT_IFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment