Skip to content

Instantly share code, notes, and snippets.

@thomashorta
Last active December 27, 2023 23:13
Show Gist options
  • Save thomashorta/71b3d1853a49a28c227e4305665c4506 to your computer and use it in GitHub Desktop.
Save thomashorta/71b3d1853a49a28c227e4305665c4506 to your computer and use it in GitHub Desktop.
Base alias file
# vars
projects_dir=$HOME/Projects
example_dir=$projects_dir/example
example_dir_android=$example_dir/example-android
# cd aliases
alias cd-proj='cd $projects_dir'
alias cd-ex='cd $example_dir'
alias cd-ex-android='cd $example_dir_android'
# git aliases
alias ga='git add'
alias gaa='git add .'
alias gb='git branch'
alias gbed='git branch --edit-description'
alias gbl='git branch -l'
alias gc='git commit'
alias gca='git commit --amend'
alias gcad='git commit --amend --date="`date -R`" --author="`git config user.name` <`git config user.email`>"'
alias gco='git checkout'
alias gcp='git cherry-pick'
alias gcpa='git cherry-pick --abort'
alias gd='git diff'
alias gdc='git diff --cached'
alias gf='git fetch'
alias gfr='git fetch && git rebase'
alias gl='git log'
alias glfp='git log --first-parent'
alias gll='git log --pretty=oneline --abbrev-commit'
alias glol='git log --oneline --decorate=false'
alias gm='git merge'
alias gma='git merge --abort'
alias gmnc='git merge --no-commit --no-ff'
alias gp='git push'
alias gpl='git pull'
alias gpub='git push -u origin `git rev-parse --abbrev-ref HEAD`'
alias gr='git rebase'
alias gra='git rebase --abort'
alias gri='git rebase -i'
alias gro='git rebase --onto'
alias grs='git reset'
alias grv='git revert'
alias gs='git status'
alias gsh='git show'
alias gshfp='git show --first-parent'
alias gst='git stash'
alias gsta='git stash apply'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash show'
alias git-remove-untracked='git fetch --prune && git branch -r | awk "{print \$1}" | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk "{print \$1}" | xargs git branch -d'
# Other aliases
alias gw='./gradlew'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment