2012-02-01 05:37:51 +01:00
|
|
|
#
|
|
|
|
# Defines Git aliases.
|
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
|
|
#
|
|
|
|
|
2011-09-05 06:37:36 +02:00
|
|
|
# Git
|
|
|
|
alias g='git'
|
|
|
|
|
2012-01-21 04:32:17 +01:00
|
|
|
# Branch (b)
|
2011-09-05 06:37:36 +02:00
|
|
|
alias gb='git branch'
|
|
|
|
alias gbc='git checkout -b'
|
|
|
|
alias gbl='git branch -v'
|
|
|
|
alias gbL='git branch -av'
|
|
|
|
alias gbx='git branch -d'
|
|
|
|
alias gbX='git branch -D'
|
|
|
|
alias gbm='git branch -m'
|
|
|
|
alias gbM='git branch -M'
|
2012-04-15 16:38:42 +02:00
|
|
|
alias gbs='git show-branch'
|
|
|
|
alias gbS='git show-branch -a'
|
2011-09-05 06:37:36 +02:00
|
|
|
|
|
|
|
# Commit (c)
|
|
|
|
alias gc='git commit'
|
|
|
|
alias gca='git commit --all'
|
|
|
|
alias gcm='git commit --message'
|
|
|
|
alias gco='git checkout'
|
|
|
|
alias gcO='git checkout HEAD --'
|
|
|
|
alias gcf='git commit --amend --reuse-message HEAD'
|
|
|
|
alias gcp='git cherry-pick --ff'
|
|
|
|
alias gcP='git cherry-pick --no-commit'
|
|
|
|
alias gcr='git revert'
|
|
|
|
alias gcR='git reset "HEAD^"'
|
|
|
|
alias gcs='git show'
|
2012-05-21 23:25:07 +02:00
|
|
|
alias gcl='git-commit-lost'
|
2011-09-05 06:37:36 +02:00
|
|
|
|
2012-01-21 04:32:17 +01:00
|
|
|
# Data (d)
|
2011-09-05 06:37:36 +02:00
|
|
|
alias gd='git ls-files'
|
|
|
|
alias gdc='git ls-files --cached'
|
|
|
|
alias gdx='git ls-files --deleted'
|
|
|
|
alias gdm='git ls-files --modified'
|
2012-01-20 19:35:31 +01:00
|
|
|
alias gdu='git ls-files --other --exclude-standard'
|
2011-09-05 06:37:36 +02:00
|
|
|
alias gdk='git ls-files --killed'
|
|
|
|
alias gdi='git status --porcelain --short --ignored | sed -n "s/^!! //p"'
|
|
|
|
|
2012-01-21 04:32:17 +01:00
|
|
|
# Fetch (f)
|
|
|
|
alias gf='git fetch'
|
|
|
|
alias gfc='git clone'
|
|
|
|
alias gfm='git pull'
|
|
|
|
alias gfr='git pull --rebase'
|
|
|
|
|
2012-09-25 05:49:58 +02:00
|
|
|
# Grep (g)
|
|
|
|
alias gg='git grep'
|
|
|
|
alias ggi='git grep --ignore-case'
|
|
|
|
alias ggl='git grep --files-with-matches'
|
|
|
|
alias ggL='git grep --files-without-matches'
|
|
|
|
alias ggv='git grep --invert-match'
|
|
|
|
alias ggw='git grep --word-regexp'
|
|
|
|
|
2012-01-21 04:32:17 +01:00
|
|
|
# Index (i)
|
|
|
|
alias gia='git add'
|
|
|
|
alias giA='git add --patch'
|
|
|
|
alias giu='git add --update'
|
|
|
|
alias gid='git diff --no-ext-diff --cached'
|
2012-03-30 18:00:14 +02:00
|
|
|
alias giD='git diff --no-ext-diff --cached --word-diff'
|
2012-04-08 20:56:14 +02:00
|
|
|
alias gir='git reset'
|
2012-03-30 18:04:59 +02:00
|
|
|
alias giR='git reset --keep'
|
2012-01-21 04:32:17 +01:00
|
|
|
alias gix='git rm -r --cached'
|
|
|
|
alias giX='git rm -rf --cached'
|
|
|
|
|
|
|
|
# Konflict (k)
|
|
|
|
alias gkl='git status | sed -n "s/^.*both [a-z]*ed: *//p"'
|
|
|
|
alias gka='git add $(gkl)'
|
|
|
|
alias gke='git mergetool $(gkl)'
|
|
|
|
alias gko='git checkout --ours --'
|
|
|
|
alias gkO='gko $(gkl)'
|
|
|
|
alias gkt='git checkout --theirs --'
|
|
|
|
alias gkT='gkt $(gkl)'
|
|
|
|
|
|
|
|
# Log (l)
|
2012-02-03 02:03:17 +01:00
|
|
|
git_log_format_medium='--pretty=format:%C(bold)Commit:%C(reset) %C(green)%H%C(red)%d%n%C(bold)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)Date:%C(reset) %C(blue)%ai (%ar)%C(reset)%n%+B'
|
2012-09-01 03:07:50 +02:00
|
|
|
git_log_format_oneline='--pretty=format:%C(green)%h%C(reset) %s%C(red)%d%C(reset)%n'
|
2012-02-03 02:03:17 +01:00
|
|
|
git_log_format_brief='--pretty=format:%C(green)%h%C(reset) %s%n%C(blue)(%ar by %an)%C(red)%d%C(reset)%n'
|
2012-01-21 04:32:17 +01:00
|
|
|
|
2012-02-01 05:53:05 +01:00
|
|
|
alias gl='git log --topo-order ${git_log_format_medium}'
|
2012-01-21 04:32:17 +01:00
|
|
|
alias gls='git log --topo-order --stat ${git_log_format_medium}'
|
|
|
|
alias gld='git log --topo-order --stat --patch --full-diff ${git_log_format_medium}'
|
2012-02-03 02:03:17 +01:00
|
|
|
alias glo='git log --topo-order ${git_log_format_oneline}'
|
|
|
|
alias glg='git log --topo-order --all --graph ${git_log_format_oneline}'
|
|
|
|
alias glb='git log --topo-order ${git_log_format_brief}'
|
2012-01-21 04:32:17 +01:00
|
|
|
alias glc='git shortlog --summary --numbered'
|
|
|
|
|
2011-09-05 06:37:36 +02:00
|
|
|
# Merge (m)
|
|
|
|
alias gm='git merge'
|
|
|
|
alias gmC='git merge --no-commit'
|
|
|
|
alias gmF='git merge --no-ff'
|
|
|
|
alias gma='git merge --abort'
|
|
|
|
alias gmt='git mergetool'
|
|
|
|
|
2012-01-21 04:32:17 +01:00
|
|
|
# Push (p)
|
2011-09-05 06:37:36 +02:00
|
|
|
alias gp='git push'
|
|
|
|
alias gpf='git push --force'
|
|
|
|
alias gpa='git push --all'
|
|
|
|
alias gpA='git push --all && git push --tags'
|
|
|
|
alias gpt='git push --tags'
|
2012-09-30 21:32:43 +02:00
|
|
|
alias gpc='git push --set-upstream origin "$(git-branch-current 2> /dev/null)"'
|
|
|
|
alias gpp='git pull origin "$(git-branch-current 2> /dev/null)" && git push origin "$(git-branch-current 2> /dev/null)"'
|
2011-09-05 06:37:36 +02:00
|
|
|
|
|
|
|
# Rebase (r)
|
|
|
|
alias gr='git rebase'
|
|
|
|
alias gra='git rebase --abort'
|
|
|
|
alias grc='git rebase --continue'
|
|
|
|
alias gri='git rebase --interactive'
|
|
|
|
alias grs='git rebase --skip'
|
|
|
|
|
2012-01-21 04:32:17 +01:00
|
|
|
# Remote (R)
|
|
|
|
alias gR='git remote'
|
|
|
|
alias gRl='git remote --verbose'
|
|
|
|
alias gRa='git remote add'
|
|
|
|
alias gRx='git remote rm'
|
|
|
|
alias gRm='git remote rename'
|
|
|
|
alias gRu='git remote update'
|
|
|
|
alias gRc='git remote prune'
|
|
|
|
alias gRs='git remote show'
|
2012-09-25 00:10:01 +02:00
|
|
|
alias gRb='git-hub-browse'
|
2012-01-21 04:32:17 +01:00
|
|
|
|
|
|
|
# Stash (s)
|
|
|
|
alias gs='git stash'
|
|
|
|
alias gsa='git stash apply'
|
2012-05-06 22:46:57 +02:00
|
|
|
alias gsc='git-stash-clear-interactive'
|
2012-01-21 04:32:17 +01:00
|
|
|
alias gsx='git stash drop'
|
2012-05-21 23:22:49 +02:00
|
|
|
alias gsd='git-stash-dropped'
|
2012-01-21 04:32:17 +01:00
|
|
|
alias gsl='git stash list'
|
|
|
|
alias gsL='git stash show --patch --stat'
|
|
|
|
alias gsp='git stash pop'
|
2012-05-21 23:22:49 +02:00
|
|
|
alias gsr='git-stash-recover'
|
2012-02-10 22:37:20 +01:00
|
|
|
alias gss='git stash save --include-untracked'
|
2012-01-21 04:32:17 +01:00
|
|
|
alias gsS='git stash save --patch --no-keep-index'
|
2012-09-25 05:49:23 +02:00
|
|
|
alias gsw='git stash save --include-untracked --keep-index'
|
2012-01-21 04:32:17 +01:00
|
|
|
|
|
|
|
# Submodule (S)
|
|
|
|
alias gS='git submodule'
|
|
|
|
alias gSa='git submodule add'
|
|
|
|
alias gSf='git submodule foreach'
|
|
|
|
alias gSi='git submodule init'
|
|
|
|
alias gSl='git submodule status'
|
2012-09-25 00:45:36 +02:00
|
|
|
alias gSm='git-submodule-move'
|
2012-01-21 04:32:17 +01:00
|
|
|
alias gSs='git submodule sync'
|
2012-06-23 20:03:25 +02:00
|
|
|
alias gSu='git submodule update --init --recursive'
|
|
|
|
alias gSU='git submodule foreach git pull origin master'
|
2012-09-25 00:45:36 +02:00
|
|
|
alias gSx='git-submodule-remove'
|
2011-09-05 06:37:36 +02:00
|
|
|
|
2012-01-21 04:32:17 +01:00
|
|
|
# Working Copy (w)
|
|
|
|
alias gws='git status --short'
|
|
|
|
alias gwS='git status'
|
|
|
|
alias gwd='git diff --no-ext-diff'
|
2012-03-30 18:00:14 +02:00
|
|
|
alias gwD='git diff --no-ext-diff --word-diff'
|
2012-01-21 04:32:17 +01:00
|
|
|
alias gwr='git reset --soft'
|
|
|
|
alias gwR='git reset --hard'
|
|
|
|
alias gwc='git clean -n'
|
|
|
|
alias gwC='git clean -f'
|
|
|
|
alias gwx='git rm -r'
|
|
|
|
alias gwX='git rm -rf'
|
2011-09-05 06:37:36 +02:00
|
|
|
|