Created
April 23, 2018 06:09
-
-
Save danshan/2e631fb9e7caff2d5a3880373086f7d2 to your computer and use it in GitHub Desktop.
show git info like 'svn info'
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/sh | |
#pushd . >/dev/null | |
# Find base of git directory | |
while [ ! -d .git ] && [ ! `pwd` = "/" ]; do cd ..; done | |
# Show various information about this git directory | |
if [ -d .git ]; then | |
echo "== Remote URL: `git remote -v`" | |
echo "== Remote Branches: " | |
git branch -r | |
echo | |
echo "== Local Branches:" | |
git branch | |
echo | |
echo "== Configuration (.git/config)" | |
cat .git/config | |
echo | |
echo "== Most Recent Commit" | |
git --no-pager log --max-count=1 | |
echo | |
echo "Type 'git log' for more commits, or 'git show' for full commit details." | |
else | |
echo "Not a git repository." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment