Skip to content

Instantly share code, notes, and snippets.

@straydogstudio
Created January 8, 2015 18:07
Show Gist options
  • Save straydogstudio/27837f5d7fc994c96f93 to your computer and use it in GitHub Desktop.
Save straydogstudio/27837f5d7fc994c96f93 to your computer and use it in GitHub Desktop.
Bash aliases
#upload changed/new files to rails with capistrano
function capdu {
if [ -z "$1" ]
then
FILES=`gst --porcelain | grep '^ M\|^\?\?' | ruby -e 'puts ARGF.map {|l| l.split()[1]}.join(",")' | xargs echo`
else
FILES=`gst --porcelain | grep '^ M\|^\?\?' | grep $1 | ruby -e 'puts ARGF.map {|l| l.split()[1]}.join(",")' | xargs echo`
fi
if [ -z "$FILES" ]
then
echo "No modified files exist"
else
echo "Sending FILES: $FILES"
cap deploy:upload FILES=$FILES deploy:restart
fi
}
# open the last database migration in sublime
alias sublm='subl db/migrate/`ls -tr db/migrate/ | tail -1`'
# bundler
alias be='bundle exec'
alias ber='bundle exec rake'
alias bes='bundle exec rspec'
alias bel='bundle exec rails'
alias beg='bundle exec guard'
# git
alias ga='git add .'
alias gc='git commit -v -a'
alias gd='git diff | subl &'
alias gl='git pull'
alias gp='git push'
alias gst='git status'
alias h='history'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment