-
-
Save sumpygump/5096826 to your computer and use it in GitHub Desktop.
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 | |
# author: Duane Johnson <[email protected]> | |
# contributor: Jansen Price <[email protected]> | |
# date: 2008 Jun 12 | |
# license: MIT | |
# | |
# Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496 | |
function main() { | |
pushd . >/dev/null | |
# Find base of git directory | |
gitdir=$(git rev-parse --git-dir 2>/dev/null) | |
# Show various information about this git directory | |
if [ -d "$gitdir" ]; then | |
echo "== Remote URL: (git remote -v)" | |
git remote -v | |
echo | |
echo "== Remote Branches: (git branch -r)" | |
git branch -r | |
echo | |
echo "== Local Branches: (git branch)" | |
git branch | |
echo | |
echo "== Configuration (.git/config)" | |
cat "$gitdir/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 | |
popd >/dev/null | |
} | |
main | less -FX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment