/usr/bin/git-info is in git-extras 1.9.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/bin/sh
get_config() {
git config --list
}
most_recent_commit() {
git log --max-count=1 --pretty=short
}
local_branches() {
git branch
}
remote_branches() {
git branch -r
}
remote_urls() {
git remote -v
}
# Show info similar to svn
echo
echo "## Remote URLs:\n"
echo "$(remote_urls)\n"
echo "## Remote Branches:\n"
echo "$(remote_branches)\n"
echo "## Local Branches:\n"
echo "$(local_branches)\n"
echo "## Most Recent Commit:\n"
echo "$(most_recent_commit)\n"
echo "Type 'git log' for more commits, or 'git show <commit id>' for full commit details.\n"
if test "$1" != "--no-config"; then
echo "## Configuration (.git/config):\n"
echo "$(get_config)\n"
fi
|