2011-01-09 15:03:49 -05:00
|
|
|
git-shortmaps provides very concise (one- or two-character), user-configurable
|
|
|
|
commands for Git with support for Bash tab completion.
|
|
|
|
|
|
|
|
# shortmaps / Bash Completion
|
|
|
|
The `bash_completion` file contains Bash completion for custom commands and
|
|
|
|
"shortmappings", which provide single-character aliases to common Git commands.
|
|
|
|
|
|
|
|
## 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
|
|
|
```
|
|
|
|
|
|
|
|
You may also add your own mappings to `~/.git-shortmaps`.
|
|
|
|
|
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
|
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
|
|
|
|
* `C` - git commit -am
|
|
|
|
* `co` - git checkout
|
|
|
|
* `d` - git diff
|
|
|
|
* `f` - git fetch
|
|
|
|
* `m` - git merge
|
|
|
|
* `p` - git push
|
|
|
|
* `P` - git pull
|
2011-10-21 11:11:44 -04:00
|
|
|
* `R` - git rebase
|
|
|
|
* `Ri` - git rebase --interactive
|
|
|
|
* `Ra` - git rebase --abort
|
|
|
|
* `Rc` - git rebase --continue
|
2011-10-18 20:09:42 -04:00
|
|
|
* `s` - git status
|
|
|
|
* `S` - git stash
|
|
|
|
* `t` - execute tig
|
|
|
|
* `T` - git tag
|
|
|
|
* `-` - git checkout -
|
|
|
|
* `--` - `cd` to root dir of repository
|
|
|
|
|
2011-10-18 20:12:03 -04:00
|
|
|
The shortmaps may only be used within a git repository. Otherwise, they will
|
|
|
|
invoke the actual command on the system.
|
|
|
|
|
2011-10-21 11:13:38 -04:00
|
|
|
If a command conflicts with an existing command on your system, wrap the command
|
|
|
|
in quotes to invoke the actual command.
|
2013-12-08 13:10:37 -05:00
|
|
|
|
2011-01-09 15:03:49 -05:00
|
|
|
## Configuration
|
|
|
|
The file format is as follows:
|
|
|
|
|
|
|
|
```
|
|
|
|
KEY COMPLETION :CMD
|
2011-10-18 20:04:11 -04:00
|
|
|
KEY COMPLETION |CMD
|
2011-01-09 15:03:49 -05:00
|
|
|
KEY COMPLETION CMD
|
|
|
|
```
|
|
|
|
|
2011-10-18 20:04:11 -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.
|