Consistency in design and formatting update.

Khas'Mek 2015-05-31 08:38:37 -04:00
parent 163425df40
commit b0e19feafb

@ -1,108 +1,89 @@
# The `git` plugin ## The git Plugin
The [`git` plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/git) provides many [aliases](#Aliases) and a few useful [functions](#Functions). The [git](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/git) plugin provides many [aliases](#Aliases) and a few useful [functions](#Functions).
Enable it by adding `git` to the [`plugins` array](https://github.com/robbyrussell/oh-my-zsh/blob/master/templates/zshrc.zsh-template#L48) before sourcing OMZ (see [[Plugins]]). Enable it by adding _git_ to the [_plugins array_](https://github.com/robbyrussell/oh-my-zsh/blob/master/templates/zshrc.zsh-template#L48) before sourcing OMZ (see [[Plugins]]).
## Aliases ## Aliases
<table> | Alias | Command |
<tr><th>Alias</th><th>Command</th></tr> |:---------------------|:-----------------------------------------------------------------------|
<tr><td><pre>g</pre></td><td><pre>git</pre></td></tr> | g | git |
<tr><td><pre>gst</pre></td><td><pre>git status</pre></td></tr> | gst | git status |
<tr><td><pre>gd</pre></td><td><pre>git diff</pre></td></tr> | gd | git diff |
<tr><td><pre>gdc</pre></td><td><pre>git diff --cached</pre></td></tr> | gdc | git diff --cached |
<tr><td><pre>gdv</pre></td><td><pre>git diff -w "$@" | view -</pre></td></tr> | gdv | git diff -w "$@" | view - |
<tr><td><pre>gl</pre></td><td><pre>git pull</pre></td></tr> | gl | git pull |
<tr><td><pre>gup</pre></td><td><pre>git pull --rebase</pre></td></tr> | gup | git pull --rebase |
<tr><td><pre>gp</pre></td><td><pre>git push</pre></td></tr> | gp | git push |
<tr><td><pre>gc</pre></td><td><pre>git commit -v</pre></td></tr> | gc | git commit -v |
<tr><td><pre>gc!</pre></td><td><pre>git commit -v --amend</pre></td></tr> | gc! | git commit -v --amend |
<tr><td><pre>gca</pre></td><td><pre>git commit -v -a</pre></td></tr> | gca | git commit -v -a |
<tr><td><pre>gca!</pre></td><td><pre>git commit -v -a --amend</pre></td></tr> | gca! | git commit -v -a --amend |
<tr><td><pre>gcmsg</pre></td><td><pre>git commit -m</pre></td></tr> | gcmsg | git commit -m |
<tr><td><pre>gco</pre></td><td><pre>git checkout</pre></td></tr> | gco | git checkout |
<tr><td><pre>gcm</pre></td><td><pre>git checkout master</pre></td></tr> | gcm | git checkout master |
<tr><td><pre>gr</pre></td><td><pre>git remote</pre></td></tr> | gr | git remote |
<tr><td><pre>grv</pre></td><td><pre>git remote -v</pre></td></tr> | grv | git remote -v |
<tr><td><pre>grmv</pre></td><td><pre>git remote rename</pre></td></tr> | grmv | git remote rename |
<tr><td><pre>grrm</pre></td><td><pre>git remote remove</pre></td></tr> | grrm | git remote remove |
<tr><td><pre>grset</pre></td><td><pre>git remote set-url</pre></td></tr> | grset | git remote set-url |
<tr><td><pre>grup</pre></td><td><pre>git remote update</pre></td></tr> | grup | git remote update |
<tr><td><pre>grbi</pre></td><td><pre>git rebase -i</pre></td></tr> | grbi | git rebase -i |
<tr><td><pre>grbc</pre></td><td><pre>git rebase --continue</pre></td></tr> | grbc | git rebase --continue |
<tr><td><pre>grba</pre></td><td><pre>git rebase --abort</pre></td></tr> | grba | git rebase --abort |
<tr><td><pre>gb</pre></td><td><pre>git branch</pre></td></tr> | gb | git branch |
<tr><td><pre>gba</pre></td><td><pre>git branch -a</pre></td></tr> | gba | git branch -a |
<tr><td><pre>gcount</pre></td><td><pre>git shortlog -sn</pre></td></tr> | gcount | git shortlog -sn |
<tr><td><pre>gcl</pre></td><td><pre>git config --list</pre></td></tr> | gcl | git config --list |
<tr><td><pre>gcp</pre></td><td><pre>git cherry-pick</pre></td></tr> | gcp | git cherry-pick |
<tr><td><pre>glg</pre></td><td><pre>git log --stat --max-count=10</pre></td></tr> | glg | git log --stat --max-count=10 |
<tr><td><pre>glgg</pre></td><td><pre>git log --graph --max-count=10</pre></td></tr> | glgg | git log --graph --max-count=10 |
<tr><td><pre>glgga</pre></td><td><pre>git log --graph --decorate --all</pre></td></tr> | glgga | git log --graph --decorate --all |
<tr><td><pre>glo</pre></td><td><pre>git log --oneline --decorate --color</pre></td></tr> | glo | git log --oneline --decorate --color |
<tr><td><pre>glog</pre></td><td><pre>git log --oneline --decorate --color --graph</pre></td></tr> | glog | git log --oneline --decorate --color --graph |
<tr><td><pre>gss</pre></td><td><pre>git status -s</pre></td></tr> | gss | git status -s |
<tr><td><pre>ga</pre></td><td><pre>git add</pre></td></tr> | ga | git add |
<tr><td><pre>gm</pre></td><td><pre>git merge</pre></td></tr> | gm | git merge |
<tr><td><pre>grh</pre></td><td><pre>git reset HEAD</pre></td></tr> | grh | git reset HEAD |
<tr><td><pre>grhh</pre></td><td><pre>git reset HEAD --hard</pre></td></tr> | grhh | git reset HEAD --hard |
<tr><td><pre>gclean</pre></td><td><pre>git reset --hard && git clean -dfx</pre></td></tr> | gclean | git reset --hard && git clean -dfx |
<tr><td><pre>gwc</pre></td><td><pre>git whatchanged -p --abbrev-commit --pretty=medium</pre></td></tr> | gwc | git whatchanged -p --abbrev-commit --pretty=medium |
<tr><td><pre>gpoat</pre></td><td><pre>git push origin --all && git push origin --tags</pre></td></tr> | gpoat | git push origin --all && git push origin --tags |
<tr><td><pre>gmt</pre></td><td><pre>git mergetool --no-prompt</pre></td></tr> | gmt | git mergetool --no-prompt |
<tr><td><pre>gg</pre></td><td><pre>git gui citool</pre></td></tr> | gg | git gui citool |
<tr><td><pre>gga</pre></td><td><pre>git gui citool --amend</pre></td></tr> | gga | git gui citool --amend |
<tr><td><pre>gk</pre></td><td><pre>gitk --all --branches</pre></td></tr> | gk | gitk --all --branches |
<tr><td><pre>gsts</pre></td><td><pre>git stash show --text</pre></td></tr> | gsts | git stash show --text |
<tr><td><pre>gsta</pre></td><td><pre>git stash</pre></td></tr> | gsta | git stash |
<tr><td><pre>gstp</pre></td><td><pre>git stash pop</pre></td></tr> | gstp | git stash pop |
<tr><td><pre>gstd</pre></td><td><pre>git stash drop</pre></td></tr> | gstd | git stash drop |
<tr><td><pre>grt</pre></td><td><pre>cd $(git rev-parse --show-toplevel || echo ".")</pre></td></tr> | grt | cd $(git rev-parse --show-toplevel || echo ".") |
<tr><td><pre>git-svn-dcommit-push</pre></td><td><pre>git svn dcommit && git push github master:svntrunk</pre></td></tr> | git-svn-dcommit-push | git svn dcommit && git push github master:svntrunk |
<tr><td><pre>gsr</pre></td><td><pre>git svn rebase</pre></td></tr> | gsr | git svn rebase |
<tr><td><pre>gsd</pre></td><td><pre>git svn dcommit</pre></td></tr> | gsd | git svn dcommit |
</table> | g | git |
| ggpull | git pull origin $(current_branch) |
| ggpur | git pull --rebase origin $(current_branch) |
| ggpush | git push origin $(current_branch) |
| ggpnp | git pull origin $(current_branch) && git push origin $(current_branch) |
| glp | Prints log with specified [format](http://git-scm.com/docs/git-log) |
## Functions ## Functions
### Current * ### Current
* `current_branch` | Command | Description |
> Returns the name of the current branch |:-------------------|:----------------------------------------|
_Example:_ `git pull origin $(current_branch)` | current_branch | Return the name of the current branch |
| current_repository | Return the names of the current remotes |
* `current_repository`
> Returns the names of the current remotes
<table>
<tr><th>Alias</th><th>Command</th></tr>
<tr><td><pre>g</pre></td><td><pre>git</pre></td></tr>
<tr><td><pre>ggpull</pre></td><td><pre>git pull origin $(current_branch)</pre></td></tr>
<tr><td><pre>ggpur</pre></td><td><pre>git pull --rebase origin $(current_branch)</pre></td></tr>
<tr><td><pre>ggpush</pre></td><td><pre>git push origin $(current_branch)</pre></td></tr>
<tr><td><pre>ggpnp</pre></td><td><pre>git pull origin $(current_branch) && git push origin $(current_branch)</pre></td></tr>
</table>
### Pretty log messages
* `glp`
> Prints log with specified [format](http://git-scm.com/docs/git-log)
_Example:_ `glp "%h - %an, %ar : %s"`
* `glp`
> Prints log with specified [format](http://git-scm.com/docs/git-log)
_Example:_ `glp "%h - %an, %ar : %s"`
### WiP ### WiP
These features allow to pause a branch development and switch to another one (_"Work in Progress"_, or wip). When you want to go back to work, just unwip it. These features allow to pause a branch development and switch to another one (_"Work in Progress"_, or wip). When you want to go back to work, just unwip it.
* `work_in_progress` | Command | Description |
> Echoes a warning if the current branch is a wip |:-----------------|:------------------------------------------------|
| work_in_progress | Echoes a warning if the current branch is a wip |
* `gwip` | gwip | Commit wip branch |
> Commit wip branch | gunwip | Uncommit wip branch |
* `gunwip`
> Uncommit wip branch