Skip to content

Instantly share code, notes, and snippets.

@rbrum
Last active July 19, 2019 18:32
Show Gist options
  • Save rbrum/8501f9a443d4ffb3e82cf88fb39e81d0 to your computer and use it in GitHub Desktop.
Save rbrum/8501f9a443d4ffb3e82cf88fb39e81d0 to your computer and use it in GitHub Desktop.
Just some Bash aliases I've come up with (or stolen) over the years
# Like the old DOS `dir`
alias dir='ls -alp'
# Simple git aliases
alias gs='git status'
alias ga='git add'
alias gaa='git add .' # "git add all"
alias gr='git rm'
alias gx='git checkout -- $1' # discard changes to file
alias gd='git diff $1'
alias gpush='git push'
alias gpu='git push' # even shorter
alias gpull='git pull'
alias gpl='git pull' # even shorter
alias gco='git checkout $1'
alias gm='git merge $1'
alias gc='git commit -m $1' # add commit msg
alias gsh='git stash'
alias gsa='git stash apply'
alias gsu='git push --set-upstream origin "$(git rev-parse --abbrev-ref HEAD)"'
alias fap='git fetch --all --prune' # "fetch all prune"
alias gb='git branch $1'
alias grn='git branch -m $1' # rename branch
alias gpa='git push acquia'
alias gbd='git branch -D $1' # "git branch delete*
alias gdel='git branch -D $1' # alias for the alias
alias gnew='git checkout -b $1' # "git new branch"
alias gcob='git checkout -b $1' # alias for the alias
alias gcm='git checkout master'
alias gback='git checkout master && git pull' # "git back (to master, then pull)"
alias gcr='git commit --amend $1' # "git commit rename" (edit last commit msg)
alias gpm='git pull origin master'
alias gblast='git push origin --delete $1' # blast away a remote branch
alias gbr='git branch -r' # shows all remote branches
# Special master reset: checkout master; pull latest; update branches; push to Acquia Cloud
alias greset='git checkout master && git pull && git fetch --all --prune && git push acquia'
# Others
alias gw='gulp watch'
alias rw='npm run watch'
alias cc='drush cr' # "clear caches"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment