Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
# Environment-tweaking
alias dotfiles='e ~/dotfiles/'
alias rsc='source ~/.bash_profile; source ~/dotfiles/bashrc'
# Shortcut for editing/reloading /etc/hosts
alias edit_hosts="mate /private/etc/hosts"
alias reload_hosts="dscacheutil -flushcache"
# Command-line fu
alias e='mate'
alias e.='mate .'
alias ll='ls -lhG'
alias l1='ls -1hG'
alias lal='ls -alhG'
alias ls='ls -hG'
alias df='df -h'
alias du='du -h'
alias cp='cp -i' # paranoia
alias mv='mv -i' # paranoia
alias rm='rm -i' # paranoia
# Lazy ancestor directory ziggurat of doom
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias .......='cd ../../../../../..'
alias ........='cd ../../../../../../..'
alias .........='cd ../../../../../../../..'
# git graph
alias gg+='git log --oneline --abbrev-commit --graph --decorate --color'
alias gga+='git log --oneline --abbrev-commit --graph --decorate --color --all'
alias gg='gg+ | head -n `expr $LINES / 2`'
alias gga='gga+ | head -n `expr $LINES / 2`'
# git
alias commit='git commit -m'
alias g='git' ; complete -o default -o nospace -F _git g
alias gb='git branch' ; complete -o default -o nospace -F _git_branch gb
alias gco='git checkout' ; complete -o default -o nospace -F _git_checkout gco
alias gcp='git cherry-pick'
alias gd='git diff --color' ; complete -o default -o nospace -F _git_diff gd
alias gff='git merge --ff-only' ; complete -o default -o nospace -F _git_branch gff
alias gnff='git merge --no-ff' ; complete -o default -o nospace -F _git_branch gnff
alias gpfwl='git push --force-with-lease'
alias gs='git status -bs'
alias gst='git status'
alias gwip='git reset --soft HEAD^ && git reset HEAD .'
alias merge='git merge --no-ff' ; complete -o default -o nospace -F _git_branch merge
# git custom commands (these will live in ~/bin/git-*)
alias gnuke_merged_branches='git nuke-merged-branches'
# Upstream 'master' branch management. Assumes these local tracking branches exist:
# * upmaster ---> tracks `upstream/master`, where `upstream` is a remote reference to the canonical shared repo
# * master ---> tracks `origin/master`, where `origin` is a remote reference to my fork of `upstream`
alias guppy='git checkout upmaster && git pull --rebase && git rebase upmaster master && git push'
# alias trout='git checkout upmaster && git merge --ff-only master && git push && git checkout master && git push'
# Faster, pussycat! Test! Test!
alias rtf='rake test:fast' # Haven't used this for years, but the comment is too funny to delete
# Rails
alias r='bundle exec rails'
alias t='bundle exec ruby -Itest'
# RSpec
alias cspec='clear ; bundle exec rspec'
alias spec='bundle exec rspec'
alias spec_ordered='bundle exec rspec --order defined'
alias spec_random='bundle exec rspec --order random'
# Bundler
alias b='bundle'
alias be='bundle exec'
alias bx='bundle exec'
alias bi='(bundle check || bundle install --jobs=4)'
alias brake='bundle exec rake'
# Pyenv
alias px='pyenv exec'
# Docker
alias dc='docker-compose'
alias dcr='docker-compose run'
alias dcrsp='docker-compose run --service-ports'
# Kubernetes (abbreviated "k8s", pronounced "cybernoodles")
alias kctl="kubectl"
alias kpods="kubectl get pods"
alias kctx="kubectx"
alias kns="kubens"
# SSH agent
alias agent='eval $(ssh-agent) && ssh-add'
alias deagent='pgrep ssh-agent | xargs kill'
alias reagent='deagent && agent'
# NPM (ugh)
alias nomdance="rm -rf node_modules && npm install"
alias yarndance="rm -rf node_modules && yarn install"