Compare commits

...

2 commits

2 changed files with 32 additions and 14 deletions

View file

@ -471,6 +471,7 @@ Command|Description
`gc [MESSAGE]`|Git commit.
`gch`|Git checkout.
`gb`|Git branch.
`gbd [BRANCH]`|Delete specified Git branch.
`gf`|Git fetch --all.
`gt`|Git tag.
`gi`|Delete files updated in git ignore.
@ -478,8 +479,7 @@ Command|Description
`gp`|Git patch (apply).
`ga`|Git add with preview.
`gr [COUNT]`|Git rebase. 2 last commits by default. 0 means from root.
`gu [NAME] [EMAIL]`|Configure git user (project).
`guv`, `guf`|My own user combos for personal and work.
`gu [EMAIL]`|Configure git user as Dmitry Voronin with specified email (project).
## Ls.

View file

@ -9,7 +9,8 @@ alias gd="git diff"
alias gc="git commit -m"
alias gch="git checkout"
alias gb="git branch --all"
alias gf="git fetch --all -v"
alias gbd="git branch -D"
alias gf="git fetch --all -v -p"
alias gt="git tag"
alias gi="git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached"
alias gpc="git diff >"
@ -46,15 +47,15 @@ gr()
fi
}
# specify git user.
# usage: gu [NAME] [EMAIL]
# specify git user as Dmitry Voronin with provided email.
# usage: gu [EMAIL]
gu()
{
local name="${1}"
local email="${2}"
local name="Dmitry Voronin"
local email="${1}"
if [[ "${name}" = "" || "${email}" = "" ]]; then
echo "usage: gu [NAME] [EMAIL]"
echo "usage: gu [EMAIL]"
return 1
fi
@ -62,10 +63,27 @@ gu()
git config user.email "${email}"
}
# some extra aliases for gu.
alias guv="gu 'Dmitry Voronin' 'account@voronind.com'"
alias guf="gu 'Dmitry Voronin' 'dd.voronin@fsight.ru'"
# autocomplete.
# _completion_loader git
# __git_complete gps _git_push
_completion_loader git
__git_complete gps _git_push
__git_complete gpsf _git_push
__git_complete gpl _git_pull
__git_complete gl _git_log
__git_complete gs _git_status
__git_complete gst _git_stash
__git_complete gd _git_diff
__git_complete gc _git_commit
__git_complete gch _git_checkout
__git_complete gb _git_branch
__git_complete gbd _git_branch
__git_complete gf _git_fetch
__git_complete gt _git_tag
__git_complete gp _git_apply
__git_complete ga _git_add
_gu()
{
_autocomplete account@voronind.com dd.voronin@fsight.ru
}
complete -F _gu gu