11817c703e708cea7231a61ca326f6fcdbe6df0b
[feisty_meow.git] / scripts / rev_control / git_info.sh
1 #!/bin/bash
2  
3 # author: Duane Johnson
4 # email: duane.johnson@gmail.com
5 # date: 2008 Jun 12
6 # license: MIT
7 #
8 # Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496
9  
10 pushd . >/dev/null
11  
12 # Find base of git directory
13 while [ ! -d .git ] && [ ! `pwd` = "/" ]; do cd ..; done
14  
15 # Show various information about this git directory
16 if [ -d .git ]; then
17 echo "== Remote URL: `git remote -v`"
18  
19 echo "== Remote Branches: "
20 git branch -r
21 echo
22  
23 echo "== Local Branches:"
24 git branch
25 echo
26  
27 echo "== Configuration (.git/config)"
28 cat .git/config
29 echo
30  
31 echo "== Most Recent Commit"
32 git --no-pager log --max-count=1
33 echo
34  
35 echo "type 'git log' for more commits, or 'git show' for full commit details."
36 else
37 echo "not a git repository."
38 fi
39  
40 popd >/dev/null