Skip to content

Instantly share code, notes, and snippets.

@belukov
Created April 24, 2017 11:30
Show Gist options
  • Select an option

  • Save belukov/b0999b6620647bfd1d41c2d3a71314e8 to your computer and use it in GitHub Desktop.

Select an option

Save belukov/b0999b6620647bfd1d41c2d3a71314e8 to your computer and use it in GitHub Desktop.
gs=`git status 2>&1`;
#echo "gs: '$gs'";
echo "";
if [[ $gs =~ 'Not a git repository' ]]; then
echo "No git";
pwd
exit 1;
fi
if [[ $gs != *'On branch master'* ]]; then
echo "WARNING: you not in master! Status:";
echo $gs;
echo "";
fi;
git branch -v | grep '^ ' | while read b_row; do
branch=`echo $b_row | cut -d ' ' -f 1`;
commit=`echo $b_row | cut -d ' ' -f 2`;
#echo "row: $branch $commit";
search=`git log | grep $commit`;
if [ -z "$search" ]; then
echo "$branch $commit";
#else
#echo "in master";
#echo "'$search'";
fi
#echo "";
#echo "";
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment