Skip to content

Commit

Permalink
refactor(aliases): sort
Browse files Browse the repository at this point in the history
- move all comments to the same line so they wont be jumbled
  • Loading branch information
georgettica committed Dec 16, 2020
1 parent 6008006 commit eb5d222
Showing 1 changed file with 88 additions and 104 deletions.
192 changes: 88 additions & 104 deletions aliases/available/git.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,131 +2,115 @@ cite 'about-alias'
about-alias 'common git abbreviations'

# Aliases
alias gcl='git clone'
alias g='git'
alias ga='git add'
alias grm='git rm'
alias gap='git add -p'
alias gall='git add -A'
alias gap='git add -p'
alias gb='git branch'
alias gbD='git branch -D'
alias gba='git branch -a'
alias gbc='git for-each-ref --format="%(authorname) %09 %(if)%(HEAD)%(then)*%(else)%(refname:short)%(end) %09 %(creatordate)" refs/remotes/ --sort=authorname DESC' # FROM https://stackoverflow.com/a/58623139/10362396
alias gbd='git branch -d'
alias gbm='git branch -m'
alias gbt='git branch --track'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gcaa='git commit -a --amend -C HEAD' # Add uncommitted and unstaged changes to the last commit
alias gcam='git commit -v -am'
alias gcamd='git commit --amend'
alias gcb='git checkout -b'
alias gci='git commit --interactive'
alias gcl='git clone'
alias gclean='git clean -fd'
alias gcm='git commit -v -m'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gcobu='git checkout -b ${USER}/'
alias gcom='git checkout master'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias gcpd='git checkout master; git pull; git branch -D'
alias gcpx='git cherry-pick -x'
alias gcsam='git commit -S -am'
alias gct='git checkout --track'
alias gd='git diff'
alias gdel='git branch -D'
alias gds='git diff --staged'
alias gdt='git difftool'
alias gdv='git diff -w "$@" | vim -R -'
alias get='git'
alias gexport='git archive --format zip --output'
alias gf='git fetch --all --prune'
alias gft='git fetch --all --prune --tags'
alias gfv='git fetch --all --prune --verbose'
alias gftv='git fetch --all --prune --tags --verbose'
alias gus='git reset HEAD'
alias gpristine='git reset --hard && git clean -dfx'
alias gclean='git clean -fd'
alias gm="git merge"
alias gmv='git mv'
alias g='git'
alias get='git'
alias gs='git status'
alias gss='git status -s'
alias gsu='git submodule update --init --recursive'
alias gfv='git fetch --all --prune --verbose'
alias gg='git log --graph --pretty=format:'%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset' --abbrev-commit --date=relative'
alias ggf='git log --graph --date=short --pretty=format:'%C(auto)%h %Cgreen%an%Creset %Cblue%cd%Creset %C(auto)%d %s''
alias ggs='gg --stat'
alias ggui='git gui'
alias ghm='cd '$(git rev-parse --show-toplevel)'' # Git home
alias gl='git pull'
alias gpl='git pull'
alias gll='git log --graph --pretty=oneline --abbrev-commit'
alias glum='git pull upstream master'
alias gpr='git pull --rebase'
alias gpp='git pull && git push'
alias gup='git fetch && git rebase'
alias gm='git merge'
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/master'
alias gmv='git mv'
alias gnew='git log HEAD@{1}..HEAD@{0}' # From http://blogs.atlassian.com/2014/10/advanced-git-aliases/ # Show commits since last pull
alias gp='git push'
alias gpatch='git format-patch -1'
alias gpd='git push --delete'
alias gpf='git push --force'
alias gpl='git pull'
alias gpo='git push origin HEAD'
alias gpom='git push origin master'
alias gpp='git pull && git push'
alias gpr='git pull --rebase'
alias gpristine='git reset --hard && git clean -dfx'
alias gprom='git fetch origin master && git rebase origin/master && git update-ref refs/heads/master origin/master' # Rebase with latest remote master
alias gpu='git push --set-upstream'
alias gpunch='git push --force-with-lease'
alias gpuo='git push --set-upstream origin'
alias gpuoc='git push --set-upstream origin $(git symbolic-ref --short HEAD)'
alias gpom='git push origin master'
alias gr='git remote'
alias grv='git remote -v'
alias gra='git remote add'
alias grb='git rebase'
alias grm='git rebase master'
alias grm='git rm'
alias grmi='git rebase master -i'
alias gd='git diff'
alias gds='git diff --staged'
alias gdt='git difftool'
alias gdv='git diff -w "$@" | vim -R -'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gcm='git commit -v -m'
alias gcam="git commit -v -am"
alias gci='git commit --interactive'
alias gcamd='git commit --amend'
alias gb='git branch'
alias gba='git branch -a'
# FROM https://stackoverflow.com/a/58623139/10362396
alias gbc='git for-each-ref --format="%(authorname) %09 %(if)%(HEAD)%(then)*%(else)%(refname:short)%(end) %09 %(creatordate)" refs/remotes/ --sort=authorname DESC'
alias gbt='git branch --track'
alias gbm='git branch -m'
alias gbd='git branch -d'
alias gbD='git branch -D'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias gcpx='git cherry-pick -x'
alias gco='git checkout'
alias gcom='git checkout master'
alias gcb='git checkout -b'
alias gcob='git checkout -b'
alias gcobu='git checkout -b ${USER}/'
alias gct='git checkout --track'
alias gcpd='git checkout master; git pull; git branch -D'
alias gexport='git archive --format zip --output'
alias gdel='git branch -D'
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/master'
alias gll='git log --graph --pretty=oneline --abbrev-commit'
alias gg="git log --graph --pretty=format:'%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset' --abbrev-commit --date=relative"
alias ggf="git log --graph --date=short --pretty=format:'%C(auto)%h %Cgreen%an%Creset %Cblue%cd%Creset %C(auto)%d %s'"
alias ggs="gg --stat"
alias gsh="git show"
alias gsl="git shortlog -sn"
alias gwc="git whatchanged"
alias gt="git tag"
alias gta="git tag -a"
alias gtd="git tag -d"
alias gtl="git tag -l"
alias gpatch="git format-patch -1"
# From http://blogs.atlassian.com/2014/10/advanced-git-aliases/
# Show commits since last pull
alias gnew="git log HEAD@{1}..HEAD@{0}"
# Add uncommitted and unstaged changes to the last commit
alias gcaa="git commit -a --amend -C HEAD"
# Rebase with latest remote master
alias gprom="git fetch origin master && git rebase origin/master && git update-ref refs/heads/master origin/master"
alias gpf="git push --force"
alias gpunch="git push --force-with-lease"
alias ggui="git gui"
alias gcsam="git commit -S -am"
# Stash aliases
alias gst="git stash"
alias gstb="git stash branch"
alias gstd="git stash drop"
alias gstl="git stash list"
# Push introduced in git v2.13.2
alias gstpu="git stash push"
alias gstpum="git stash push -m"
# Save deprecated since git v2.16.0
# - aliases now resolve to push
alias gsts="git stash push"
alias gstsm="git stash push -m"
# Alias gstpo added for symmetry with gstpu (push)
# - gstp remains as alias for pop due to long-standing usage
alias gstpo="git stash pop"
alias gstp="git stash pop"
# Switch aliases - Requires git v2.23+
alias gsw="git switch"
alias gswm="git switch master"
alias gswc="git switch --create"
alias gswt="git switch --track"
# Git home
alias ghm='cd "$(git rev-parse --show-toplevel)"'
alias grv='git remote -v'
alias gs='git status'
alias gsd='git svn dcommit'
alias gsh='git show'
alias gsl='git shortlog -sn'
alias gsr='git svn rebase' # Git SVN
alias gss='git status -s'
alias gst='git stash' # Stash aliases
alias gstb='git stash branch'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gstpo='git stash pop' # Alias gstpo added for symmetry with gstpu (push) # - gstp remains as alias for pop due to long-standing usage
alias gstpu='git stash push' # Push introduced in git v2.13.2
alias gstpum='git stash push -m'
alias gsts='git stash push' # Save deprecated since git v2.16.0 # - aliases now resolve to push
alias gstsm='git stash push -m'
alias gsu='git submodule update --init --recursive'
alias gsw='git switch' # Switch aliases - Requires git v2.23+
alias gswc='git switch --create'
alias gswm='git switch master'
alias gswt='git switch --track'
alias gt='git tag'
alias gta='git tag -a'
alias gtd='git tag -d'
alias gtl='git tag -l'
alias gu='git ls-files . --exclude-standard --others' # Show untracked files
alias gup='git fetch && git rebase'
alias gus='git reset HEAD'
alias gwc='git whatchanged'

if ! _command_exists gh; then
alias gh='ghm'
fi
# Show untracked files
alias gu='git ls-files . --exclude-standard --others'

# Git SVN
alias gsr='git svn rebase'
alias gsd='git svn dcommit'

case $OSTYPE in
darwin*)
alias gtls="git tag -l | gsort -V"
Expand Down

0 comments on commit eb5d222

Please sign in to comment.