Skip to content

Instantly share code, notes, and snippets.

@yonchu
Created October 23, 2012 01:14
Show Gist options
  • Select an option

  • Save yonchu/3936073 to your computer and use it in GitHub Desktop.

Select an option

Save yonchu/3936073 to your computer and use it in GitHub Desktop.
Gitリポジトリの色んな情報を表示. どんなリポジトリなのかを瞬時に把握するのに便利
if [ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" != "true" ]; then
echo 'Error: Not a git repository' 2>&1
return 1
fi
echo "===== git status -sb ====="
git status -sb
(
cd "$(git rev-parse --show-toplevel)" >/dev/null 2>&1;
echo "===== git submodule status ====="
echo -e '## \033[0;34msubmodule\033[0;39m'
git submodule status
)
echo
echo "===== git remote -v ====="
git remote -v
echo "===== git branch -av ====="
git branch -av
echo "===== git stash list ====="
git stash list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment