2013-07-08 22:11:44 -04:00
|
|
|
git-shortmaps provides very concise (mostly one- and two-character),
|
|
|
|
user-configurable commands for Git with support for Bash tab completion.
|
2011-01-09 15:03:49 -05:00
|
|
|
|
|
|
|
# shortmaps / Bash Completion
|
|
|
|
The `bash_completion` file contains Bash completion for custom commands and
|
|
|
|
"shortmappings", which provide single-character aliases to common Git commands.
|
|
|
|
|
2014-08-21 23:41:34 -04:00
|
|
|
|
2011-01-09 15:03:49 -05:00
|
|
|
## Setup
|
|
|
|
Source the `bash_completion` file (e.g. place in `.bashrc` or in
|
|
|
|
`/etc/bash_completion.d/` on Debian systems), with the path to the provided
|
2013-12-08 13:41:59 -05:00
|
|
|
`shortmaps` file as the only argument:
|
2011-01-09 15:03:49 -05:00
|
|
|
|
|
|
|
```
|
2013-12-08 13:41:59 -05:00
|
|
|
$ . bash_completion ./shortmaps
|
2011-01-09 15:03:49 -05:00
|
|
|
```
|
|
|
|
|
2014-08-21 23:41:34 -04:00
|
|
|
You may also add your own mappings to `~/.git-shortmaps`, which is sourced
|
|
|
|
automatically and will take precedence over any other mappings.
|
|
|
|
|
2011-01-09 15:03:49 -05:00
|
|
|
|
2011-10-18 20:09:42 -04:00
|
|
|
## Usage
|
|
|
|
By default, the following mappings are available, each with tab completion:
|
|
|
|
|
|
|
|
* `a` - git add
|
|
|
|
* `A` - git add -A
|
2014-11-20 21:52:35 -05:00
|
|
|
* `AS` - git add -A && git push
|
2014-08-21 22:43:26 -04:00
|
|
|
* `b` - git branch
|
2015-05-11 15:06:15 -04:00
|
|
|
* `bd` - git branch --delete
|
|
|
|
* `bd-` - delete branch `@{-1}`
|
2014-08-21 22:43:26 -04:00
|
|
|
* `bv` - git branch -v
|
2011-10-21 11:13:38 -04:00
|
|
|
* `B` - git bisect
|
|
|
|
* `Bs` - git bisect start
|
|
|
|
* `Bg` - git bisect good
|
|
|
|
* `Bb` - git bisect bad
|
|
|
|
* `Br` - git bisect reset
|
2011-10-18 20:09:42 -04:00
|
|
|
* `c` - git commit
|
2012-04-30 23:31:40 -04:00
|
|
|
* `ca` - git commit --amend
|
2011-10-18 20:09:42 -04:00
|
|
|
* `co` - git checkout
|
2012-04-30 23:31:40 -04:00
|
|
|
* `C` - git commit -am
|
|
|
|
* `CS` - git commit -S -am
|
2011-10-18 20:09:42 -04:00
|
|
|
* `d` - git diff
|
2012-06-26 23:24:42 -04:00
|
|
|
* `ds` - git diff --stat
|
2011-10-18 20:09:42 -04:00
|
|
|
* `f` - git fetch
|
2014-08-21 22:52:08 -04:00
|
|
|
* `L` - git log --show-signature
|
|
|
|
* `Ld` - git log --show-signature --decorate
|
|
|
|
* `Lf` - git log --show-signature --first-parent
|
|
|
|
* `Lg` - git log --show-signature --graph
|
|
|
|
* `Lgd` - git log --show-signature --graph --decorate
|
|
|
|
* `Lm` - git log --show-signature --merges
|
|
|
|
* `Ln` - git log --show-signature --no-merges
|
2011-10-18 20:09:42 -04:00
|
|
|
* `m` - git merge
|
2013-08-19 23:04:15 -04:00
|
|
|
* `ma` - git merge --abort
|
2014-11-20 21:52:35 -05:00
|
|
|
* `mm` - git merge --no-ff
|
|
|
|
* `M` - git submodule
|
|
|
|
* `Mi` - git submodule update --init --recursive
|
|
|
|
* `Mu` - git submodule update
|
|
|
|
* `MP` - git submodule update --remote
|
2011-10-18 20:09:42 -04:00
|
|
|
* `p` - git push
|
2014-11-20 21:52:35 -05:00
|
|
|
* `pu` - git push --set-upstream
|
2011-10-18 20:09:42 -04:00
|
|
|
* `P` - git pull
|
2014-06-18 10:30:30 -04:00
|
|
|
* `Pr` - git pull --rebase=preserve
|
|
|
|
* `Prp` - git pull --rebase=preserve && git push
|
2014-11-20 21:52:35 -05:00
|
|
|
* `r` - git reset
|
2015-05-14 23:43:28 -04:00
|
|
|
* `r@` - git reset @
|
|
|
|
* `r@:`- git reset @ :/
|
|
|
|
* `r@*` - git reset @ *
|
2014-11-20 21:52:35 -05:00
|
|
|
* `rh` - git reset HEAD :/
|
2011-10-21 11:11:44 -04:00
|
|
|
* `R` - git rebase
|
|
|
|
* `Ri` - git rebase --interactive
|
|
|
|
* `Ra` - git rebase --abort
|
|
|
|
* `Rc` - git rebase --continue
|
2012-03-24 19:14:07 -04:00
|
|
|
* `s` - git status --short
|
2011-10-18 20:09:42 -04:00
|
|
|
* `S` - git stash
|
2014-08-21 22:42:23 -04:00
|
|
|
* `Sa` - git stash apply
|
|
|
|
* `Sl` - git stash list
|
|
|
|
* `Sp` - git stash pop
|
|
|
|
* `Ss` - git stash show
|
2011-10-18 20:09:42 -04:00
|
|
|
* `t` - execute tig
|
|
|
|
* `T` - git tag
|
|
|
|
* `-` - git checkout -
|
|
|
|
* `--` - `cd` to root dir of repository
|
2014-08-21 23:43:48 -04:00
|
|
|
* `?` - display all shortmaps
|
2011-10-18 20:09:42 -04:00
|
|
|
|
2014-08-21 23:41:34 -04:00
|
|
|
The shortmaps may only be used within a Git repository; otherwise, they will
|
2011-10-18 20:12:03 -04:00
|
|
|
invoke the actual command on the system.
|
|
|
|
|
2014-08-21 23:41:34 -04:00
|
|
|
If a shortmap conflicts with an existing command on your system, then you
|
|
|
|
may either unalias the map, or use `command X` to invoke the system command
|
|
|
|
`X`.
|
2013-12-08 13:10:37 -05:00
|
|
|
|
2014-08-21 23:36:37 -04:00
|
|
|
|
2011-01-09 15:03:49 -05:00
|
|
|
## Configuration
|
|
|
|
The file format is as follows:
|
|
|
|
|
|
|
|
```
|
2014-08-21 23:41:34 -04:00
|
|
|
key completion :cmd
|
|
|
|
key completion |cmd
|
|
|
|
key completion cmd
|
2011-01-09 15:03:49 -05:00
|
|
|
```
|
|
|
|
|
2014-08-21 23:41:34 -04:00
|
|
|
If `cmd` contains a colon (`:`) prefix, the command will be prefixed with
|
|
|
|
`git`. If prefixed with a pipe (`|`), the command will be sent to `eval`
|
|
|
|
(needed for certain features like subshells). Commands without either prefix
|
|
|
|
will be executed normally.
|
2014-08-21 23:36:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
This program is free software: you can redistribute it and/or modify it
|
|
|
|
under the terms of the GNU General Public License as published by the Free
|
|
|
|
Software Foundation, either version 3 of the License, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
more details.
|
|
|
|
|