Skip to content

Instantly share code, notes, and snippets.

@michaek
Last active December 3, 2015 07:05
Show Gist options
  • Save michaek/1926339 to your computer and use it in GitHub Desktop.
Save michaek/1926339 to your computer and use it in GitHub Desktop.
Bash Aliases
# here
alias vba='vim ~/.bash_aliases'
alias mba='mate ~/.bash_aliases'
alias sba='subl ~/.bash_aliases'
alias ba='source ~/.bash_aliases'
# profile
alias sbp='subl ~/.bash_profile'
alias bp='source ~/.bash_profile'
# bundle
alias bu='bundle'
alias be='bundle exec'
# shell
alias l="ls -al"
alias h="cd ~"
alias t="trash"
# editor
st() {
TARGET=$1
: ${TARGET:="."}
subl -n "$TARGET"
}
alias at='atom'
# git
alias ga='git add'
alias gb='git branch'
alias gc='git commit -m'
alias gca='git commit -am'
alias gd='git diff'
alias gf='git fetch'
alias gk='git checkout'
alias gl='git pull'
alias gg='git merge'
alias gp='git push'
alias gpt='git push && git push --tags'
alias gs='git status'
alias gt='git tag'
alias gw='git-flow'
git-edit() {
subl $(git status --short | awk '$1 ~ /^M$/ {print $2}')
}
alias ge='git-edit'
git-commit-feature(){
feature=`git describe --contains --all HEAD | sed s/feature\\\///`
gc "$feature: $1"
}
alias gcf='git-commit-feature'
# grunt
alias g='grunt'
# rails
alias r='bundle exec rails'
alias rk='bundle exec rake'
# heroku
alias he='heroku'
alias her='heroku run'
hep() {
REMOTE=$1
: ${REMOTE:="heroku"}
echo "Pushing current branch to $REMOTE master."
git push "$REMOTE" `__git_branch`:master;
}
# misc
alias w='python -m SimpleHTTPServer'
alias fr='foreman start'
alias dns='sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist && sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist'
# Java
# alias usejava6="export JAVA_HOME=`/usr/libexec/java_home --version 1.6`"
alias usejava7="export JAVA_HOME=`/usr/libexec/java_home --version 1.7`"
usejava7
# Grails
alias grr='gr clean && gr run-app'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment