Skip to content

Instantly share code, notes, and snippets.

Last active August 11, 2022 14:46
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Bash Aliases

To add aliases to BASH in windows

  1. open terminal
  2. cd ~
  3. touch .bashrc
  4. code .bashrc
  5. paste the following aliases and/or add your own
  6. Restart terminal


alias g='git'
alias gst='git status'
alias gl='git pull'
alias gp='git push'

alias gcam='git commit -a -m'
alias gcmsg='git commit -m'

alias gco='git checkout'
alias gcob="git checkout -b"
alias gcm='git checkout master'

alias gb='git branch'

alias ga='git add'
alias gaa='git add -A'
alias gm='git merge'

# hard reset
alias gclean='git reset --hard && git clean -df'

# add a name after this to make the stash memorable
alias gss='git stash save'

# list all stashes
alias gslist='git stash list'

#ddev aliases
alias export-db='ddev export-db --gzip=false --file=db.sql'
alias export-db-gzip='ddev export-db --file=db.sql.gz'

# delete the most recent stash
# unfortunately unable to pass parameter to delete a stash.
# manually do that with git stash drop stash@{1} 
# where @{1} is the position in the stash list
alias gsdel='git stash drop'

# delete all stash entries
alias gsclear="git stash clear"

# nuke folders
alias nuke-vendor='rm -rf vendor/'
alias nuke-node='rm -rf node_modules/ && npm i'

# Retrieve current public IP address
alias myip='curl; echo'

# Get rid of any, uncommmited, changes in repo
alias nah='git clean -fd && git reset --hard HEAD'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment