Created
November 22, 2010 12:13
-
-
Save noqqe/709879 to your computer and use it in GitHub Desktop.
function to get a quick overview for your git repo
This file contains 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 | |
# get a quick overview for your git repo | |
function git_info() { | |
if [ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]; then | |
# print informations | |
echo "git repo overview" | |
echo "-----------------" | |
echo | |
# print all remotes and thier details | |
for remote in $(git remote show); do | |
echo $remote: | |
git remote show $remote | |
echo | |
done | |
# print status of working repo | |
echo "status:" | |
if [ -n "$(git status -s 2> /dev/null)" ]; then | |
git status -s | |
else | |
echo "working directory is clean" | |
fi | |
# print at least 5 last log entries | |
echo | |
echo "log:" | |
git log -5 --oneline | |
echo | |
else | |
echo "you're currently not in a git repository" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment