dots/git-info
David Majnemer c0851b91a3 git inf
2010-09-02 11:33:04 -05:00

35 lines
653 B
Bash
Executable file

#! /bin/sh
# based on a script by Duane Johnson with some simplifications
CDPATH=`git rev-parse --show-cdup`
# not a valid git repo? leave
if [ $? -ne 0 ] ; then
exit
fi
# switch to the directory holding .git
if [ -n "${CDPATH}" ] ; then
cd "${CDPATH}"
fi
# Show various information about this git directory
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."