mirror of
https://github.com/paulirish/git-recent.git
synced 2026-09-10 07:26:16 -04:00
⛷
This commit is contained in:
commit
59506473c2
30
git-recent
Executable file
30
git-recent
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
|
||||
##
|
||||
## git-recent
|
||||
##
|
||||
## list all local branches, sorted by last commit, formatted reall purdy
|
||||
##
|
||||
|
||||
format="\
|
||||
%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|\
|
||||
%(color:bold red)%(objectname:short) %(color:bold green)(%(committerdate:relative)) %(color:blue)%(authorname)%0a\
|
||||
%(color:black) %(color:reset)|%(contents:subject)%0a\
|
||||
|"
|
||||
|
||||
lessopts="--tabs=4 --quit-if-one-screen --RAW-CONTROL-CHARS --no-init"
|
||||
|
||||
git for-each-ref \
|
||||
--sort=-committerdate \
|
||||
"refs/heads/" \
|
||||
--format="$format" \
|
||||
| column -ts '|' \
|
||||
| less "$lessopts"
|
||||
|
||||
# The above command:
|
||||
# for all known branches,
|
||||
# sort descending by last commit
|
||||
# show local branches (change to "" to include both local + remote branches)
|
||||
# apply the formatting template above
|
||||
# break into columns
|
||||
# use the pager only if there's not enough space
|
||||
25
package.json
Normal file
25
package.json
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "git-recent",
|
||||
"version": "1.0.0",
|
||||
"description": "List recent git branches, formatted so fancy",
|
||||
"bin": {
|
||||
"git-recent": "git-recent"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/paulirish/git-recent.git"
|
||||
},
|
||||
"keywords": [
|
||||
"git",
|
||||
"branches"
|
||||
],
|
||||
"author": "Paul Irish",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/paulirish/git-recent/issues"
|
||||
},
|
||||
"homepage": "https://github.com/paulirish/git-recent#readme"
|
||||
}
|
||||
30
readme.md
Normal file
30
readme.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# git-open
|
||||
|
||||
Type `git recent` to see your latest local git branches
|
||||
|
||||
## Usage
|
||||
|
||||
git recent
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
### Installation
|
||||
|
||||
You can add the `git-recent` location o your path (e.g. add the directory to your `PATH` environment
|
||||
or copy `git-open` into an existing included path like `/usr/local/bin` or `~/bin/`).
|
||||
|
||||
You can use also `npm` to install an OLD (1 year ago) version of this package:
|
||||
|
||||
npm install --global git-open
|
||||
|
||||
## License
|
||||
|
||||
Copyright Paul Irish. Licensed under MIT.
|
||||
|
||||
|
||||
## Changelog
|
||||
|
||||
- **2016-05-16** - added to [paulirish/dotfiles](https://github.com/paulirish/dotfiles/commit/1ca1ff760832af558447145fa2a367046b1829d2)
|
||||
- **2016-08-05** - released in standalone repo and published to npm
|
||||
Loading…
Reference in a new issue