Created
April 14, 2014 02:38
-
-
Save zaki/10611979 to your computer and use it in GitHub Desktop.
Some aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias st='stree' | |
alias rpc='rake rpc' | |
alias remas='rake master:copy && rake master:all' | |
alias rest='remig test && s' | |
alias gcozm='g checkout zaki-master' | |
alias gpzm='g push zaki zaki-master:master' | |
alias grhom='g reset --hard origin/master' | |
alias zm='g checkout zaki-master' | |
alias om='g reset --hard origin/master' | |
alias zmas='zm && gru && om && gpzm' | |
# Use gync to git-sync a branch between two repositories | |
# in this case between origin and zaki | |
# Example: | |
# $ gync v1.0.0 | |
function gync() { | |
branch=$1 | |
if [[ -z $branch ]] | |
then | |
echo "Usage: gync <branch>" | |
else | |
git checkout $branch | |
git remote update | |
git reset --hard origin/$branch | |
git push zaki $branch:$branch | |
fi | |
} | |
# Use ver to check out and update a local branch | |
# Example: | |
# $ ver v1.0.0 | |
function ver() { | |
branch=$1 | |
if [[ -z $branch ]] | |
then | |
echo "Usage: ver <branch>" | |
else | |
git checkout $branch | |
git remote update | |
git reset --hard origin/$branch | |
fi | |
} | |
# Use gmo to merge a branch from origin locally | |
# Example: | |
# $ gmo some-pull-request-branch | |
function gmo() { | |
branch=$1 | |
if [[ -z $branch ]] | |
then | |
echo "Usage: gmo <branch>" | |
else | |
git merge origin/$branch | |
fi | |
} | |
# Remigrate, reseed and remaster the database | |
# Example: | |
# $ remig test | |
function remig() { | |
stage=$1 | |
if [[ -z $stage ]]; then | |
stage="development" | |
fi | |
echo "Remigrating $stage" | |
padrino rake ar:drop -e $stage && \ | |
padrino rake ar:create -e $stage && \ | |
padrino rake ar:migrate -e $stage && \ | |
} | |
# Completely wipe and recreate the database | |
# Example | |
# $ redb development | |
function redb() { | |
stage="development" | |
padrino rake ar:drop -e $stage && \ | |
padrino rake ar:create -e $stage && \ | |
padrino rake ar:migrate -e $stage && \ | |
padrino rake rpc -e $stage && \ | |
padrino rake master:copy -e $stage && \ | |
padrino rake master:all -e $stage && \ | |
padrino rake seed -e $stage | |
} | |
# Use rsf to run focus specs only | |
# Example: | |
# $ rsf spec/models/user.rb | |
function rsf() { | |
rspec --tag=focus $@ | |
} | |
alias omg='git clean -ffd && git checkout zaki-master && git remote update && git reset --hard origin/master' | |
alias gomi=omg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment