mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Added git-info command.
Updated Authors document to include the name of the person whose idea this was.
This commit is contained in:
parent
363338a55e
commit
e3952df2c1
2
AUTHORS
2
AUTHORS
|
|
@ -20,3 +20,5 @@ Patches and Suggestions
|
|||
- Gert Van Gool
|
||||
- Devin Withers
|
||||
- David Baumgold
|
||||
- Leila Muhtasib
|
||||
- Duane Johnson
|
||||
40
bin/git-info
Executable file
40
bin/git-info
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
#!/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"
|
||||
|
||||
echo "## Configuration (.git/config):\n"
|
||||
echo "$(get_config)\n"
|
||||
Loading…
Reference in a new issue