Created
October 23, 2012 01:14
-
-
Save yonchu/3936073 to your computer and use it in GitHub Desktop.
Gitリポジトリの色んな情報を表示. どんなリポジトリなのかを瞬時に把握するのに便利
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if ! type git > /dev/null 2>&1; then | |
| echo 'Error: Git is not installed.' 2>%1 | |
| exit 1 | |
| fi | |
| if [ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" != "true" ]; then | |
| echo 'Error: Not a git repository' 2>&1 | |
| exit 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