-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitinfo.sh
More file actions
executable file
·47 lines (37 loc) · 1.04 KB
/
gitinfo.sh
File metadata and controls
executable file
·47 lines (37 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash -
#===============================================================================
#
# FILE: gitinfo.sh
#
# USAGE: ./gitinfo.sh
#
# DESCRIPTION:
# AUTHOR: Duane Johnson
# EMAIL: duane.johnson@gmail.com
# DATE: 2008 Jun 12
# LICENSE: MIT
#===============================================================================
set -o nounset # Treat unset variables as an error
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 --pretty=format'%h was %an, %ar: %s' --graph
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