Skip to content

Instantly share code, notes, and snippets.

@CreateSean
Last active February 8, 2024 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CreateSean/057df35c49eba9e2a1401530f797d19a to your computer and use it in GitHub Desktop.
Save CreateSean/057df35c49eba9e2a1401530f797d19a to your computer and use it in GitHub Desktop.
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

Aliases

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 http://ipecho.net/plain; 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