Skip to content

Instantly share code, notes, and snippets.

@tuomasj
Created October 22, 2017 08:30
Show Gist options
  • Save tuomasj/8b86020dbc3f73c3f03c875a6ad3c4f0 to your computer and use it in GitHub Desktop.
Save tuomasj/8b86020dbc3f73c3f03c875a6ad3c4f0 to your computer and use it in GitHub Desktop.
Bash shell aliases
# Assuming that ~/.bash_aliases has the aliases defined
# These work on Bash, not sure what happens with other shells
# Run previous command
alias r='fc -s'
# Open .vimrc
alias vimrc="vim ~/.vimrc"
# Reload aliases
alias reload="source ~/.bash_aliases && echo 'Aliases reloaded'"
# Edit aliases and reload
alias aliases="vim ~/.bash_aliases && reload"
# Run Foreman with Procfile.local, if it exists, then try Foreman with Procfile, if all fails, print an error message
alias fore="(test -f Procfile.local && foreman start -f Procfile.local) || (test -f Procfile && foreman start -f Procfile) || echo \"No Procfile found\""
# Shortcut to Sublime Test (Mac OS)
alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n"
# Use color output with ls
alias ls="ls -F --color=always"
# Bundler specific
alias ber='bundle exec rake'
alias be='bundle exec'
# Git specific
alias gc="git checkout"
alias gd="git diff --cached"
alias ga='git add'
alias gp='git push'
alias gl="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
alias gs='git status'
alias gd='git diff'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment