Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
7654b16b
Commit
7654b16b
authored
Aug 07, 2016
by
Marc Cornellà
Browse files
[git plugin] Fix indentation and organise aliases
parent
f5537241
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/git/git.plugin.zsh
View file @
7654b16b
...
@@ -81,62 +81,73 @@ alias gd='git diff'
...
@@ -81,62 +81,73 @@ alias gd='git diff'
alias
gdca
=
'git diff --cached'
alias
gdca
=
'git diff --cached'
alias
gdct
=
'git describe --tags `git rev-list --tags --max-count=1`'
alias
gdct
=
'git describe --tags `git rev-list --tags --max-count=1`'
alias
gdt
=
'git diff-tree --no-commit-id --name-only -r'
alias
gdt
=
'git diff-tree --no-commit-id --name-only -r'
alias
gdw
=
'git diff --word-diff'
gdv
()
{
git diff
-w
"
$@
"
| view -
}
gdv
()
{
git diff
-w
"
$@
"
| view -
}
compdef _git
gdv
=
git-diff
compdef _git
gdv
=
git-diff
alias
gdw
=
'git diff --word-diff'
alias
gf
=
'git fetch'
alias
gf
=
'git fetch'
alias
gfa
=
'git fetch --all --prune'
alias
gfa
=
'git fetch --all --prune'
alias
gfo
=
'git fetch origin'
function
gfg
()
{
git ls-files |
grep
$@
}
function
gfg
()
{
git ls-files |
grep
$@
}
compdef _grep gfg
compdef _grep gfg
alias
gfo
=
'git fetch origin'
alias
gg
=
'git gui citool'
alias
gg
=
'git gui citool'
alias
gga
=
'git gui citool --amend'
alias
gga
=
'git gui citool --amend'
ggf
()
{
ggf
()
{
[[
"$#"
!=
1
]]
&&
local
b
=
"
$(
git_current_branch
)
"
[[
"$#"
!=
1
]]
&&
local
b
=
"
$(
git_current_branch
)
"
git push
--force
origin
"
${
b
:
=
$1
}
"
git push
--force
origin
"
${
b
:
=
$1
}
"
}
}
compdef _git
ggf
=
git-checkout
compdef _git
ggf
=
git-checkout
ggl
()
{
ggl
()
{
if
[[
"$#"
!=
0
]]
&&
[[
"$#"
!=
1
]]
;
then
if
[[
"$#"
!=
0
]]
&&
[[
"$#"
!=
1
]]
;
then
git pull origin
"
${
*
}
"
git pull origin
"
${
*
}
"
else
else
[[
"$#"
==
0
]]
&&
local
b
=
"
$(
git_current_branch
)
"
[[
"$#"
==
0
]]
&&
local
b
=
"
$(
git_current_branch
)
"
git pull origin
"
${
b
:
=
$1
}
"
git pull origin
"
${
b
:
=
$1
}
"
fi
fi
}
}
compdef _git
ggl
=
git-checkout
compdef _git
ggl
=
git-checkout
alias
ggpull
=
'git pull origin $(git_current_branch)'
compdef _git
ggpull
=
git-checkout
ggp
()
{
ggp
()
{
if
[[
"$#"
!=
0
]]
&&
[[
"$#"
!=
1
]]
;
then
if
[[
"$#"
!=
0
]]
&&
[[
"$#"
!=
1
]]
;
then
git push origin
"
${
*
}
"
git push origin
"
${
*
}
"
else
else
[[
"$#"
==
0
]]
&&
local
b
=
"
$(
git_current_branch
)
"
[[
"$#"
==
0
]]
&&
local
b
=
"
$(
git_current_branch
)
"
git push origin
"
${
b
:
=
$1
}
"
git push origin
"
${
b
:
=
$1
}
"
fi
fi
}
}
compdef _git
ggp
=
git-checkout
compdef _git
ggp
=
git-checkout
alias
ggpush
=
'git push origin $(git_current_branch)'
compdef _git
ggpush
=
git-checkout
ggpnp
()
{
ggpnp
()
{
if
[[
"$#"
==
0
]]
;
then
if
[[
"$#"
==
0
]]
;
then
ggl
&&
ggp
ggl
&&
ggp
else
else
ggl
"
${
*
}
"
&&
ggp
"
${
*
}
"
ggl
"
${
*
}
"
&&
ggp
"
${
*
}
"
fi
fi
}
}
compdef _git
ggpnp
=
git-checkout
compdef _git
ggpnp
=
git-checkout
alias
ggsup
=
'git branch --set-upstream-to=origin/$(git_current_branch)'
ggu
()
{
ggu
()
{
[[
"$#"
!=
1
]]
&&
local
b
=
"
$(
git_current_branch
)
"
[[
"$#"
!=
1
]]
&&
local
b
=
"
$(
git_current_branch
)
"
git pull
--rebase
origin
"
${
b
:
=
$1
}
"
git pull
--rebase
origin
"
${
b
:
=
$1
}
"
}
}
compdef _git
ggu
=
git-checkout
compdef _git
ggu
=
git-checkout
alias
ggpur
=
'ggu'
alias
ggpur
=
'ggu'
compdef _git
ggpur
=
git-checkout
compdef _git
ggpur
=
git-checkout
alias
ggpull
=
'git pull origin $(git_current_branch)'
compdef _git
ggpull
=
git-checkout
alias
ggpush
=
'git push origin $(git_current_branch)'
compdef _git
ggpush
=
git-checkout
alias
ggsup
=
'git branch --set-upstream-to=origin/$(git_current_branch)'
alias
gignore
=
'git update-index --assume-unchanged'
alias
gignore
=
'git update-index --assume-unchanged'
alias
gignored
=
'git ls-files -v | grep "^[[:lower:]]"'
alias
gignored
=
'git ls-files -v | grep "^[[:lower:]]"'
alias
git-svn-dcommit-push
=
'git svn dcommit && git push github master:svntrunk'
alias
git-svn-dcommit-push
=
'git svn dcommit && git push github master:svntrunk'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment