Skip to content

Instantly share code, notes, and snippets.

@watr
Created February 25, 2013 05:20
Show Gist options
  • Save watr/5027921 to your computer and use it in GitHub Desktop.
Save watr/5027921 to your computer and use it in GitHub Desktop.
Print all git remote branches.
#!/bin/bash
current_directory=`pwd`;
echo "current directory: ""$current_directory";
find . -name ".git" | while read local_git_folder;
do
cd "$local_git_folder";
cd ..;
parent=`pwd`;
name=`basename "$parent"`;
remote=`git remote -v`;
if [ -n "$remote" ]; then
echo "";
echo "$name";
echo "$parent";
echo "$remote";
fi;
cd "$current_directory";
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment