Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gist of helpful commands that I use in development.
PATH=$PATH:~/bin
export PATH
alias ll='ls -lah'
# Git aliases
alias softreset='git reset --soft HEAD^'
alias hardreset='git reset --hard HEAD^'
# Following http://viget.com/inspire/terminal-aliases-for-git
alias gst='git status'
alias gc='git commit'
alias gco='git checkout'
alias gl='git pull'
alias gpom="git pull origin master"
alias gp='git push'
alias gd='git diff | mate'
alias gb='git branch'
alias gba='git branch -a'
alias del='git branch -d'
alias assume='git update-index --no-assume-unchanged'
quickpush(){
git add -A
if [ "$1" = "" ]
then
gc -am 'quick push'
else
gc -am $1
fi
gp origin master
}
# Directory helpers
alias tosites='cd ~/Documents/Websites/'
alias opensites='open ~/Documents/Websites'
totheme() {
# Case for being in root of website ex. www.test.dev
if [ "$2" = "" ]
then
cd wp-content/themes
if [ "$1" = "" ]
then
cd cw
else
cd $1
fi
else
tosites
cd $1
cd wp-content/themes
if [ "$2" = "" ]
then
cd cw
else
cd $2
fi
fi
}
toplugin() {
# Case for being in root of website ex. www.test.dev
if [ "$2" = "" ]
then
cd wp-content/plugins
if [ "$1" = "" ]
then
cd cw
else
cd $1
fi
else
tosites
cd $1
cd wp-content/plugins
if [ "$2" = "" ]
then
cd cw
else
cd $2
fi
fi
}
dowork() {
if [ "$1" = "" ] ; then
echo "ERROR: You must pass in a URL as first parameter"
fi
if [ "$2" = "" ]
then
totheme $1 cw
else
totheme $1 $2
fi
open -a "Google Chrome" http://$1
atom .
grunt
}
@fleeting

This comment has been minimized.

Copy link

@fleeting fleeting commented Apr 28, 2014

Line #27 I wouldn't advise having a default git commit message as then you might end up with a git history full of quick push.

@itsananderson

This comment has been minimized.

Copy link

@itsananderson itsananderson commented Apr 29, 2014

Line #8. Should that actually be git reset --hard HEAD^ for the hardreset alias?

@ebinnion

This comment has been minimized.

Copy link
Owner Author

@ebinnion ebinnion commented May 1, 2014

James - I have that there mostly to support Joel's workflow. He often pulls down code from Git, edits locally, and then pushed it to the development server - As opposed to using a local development environment. I do agree that it could definitely be misused though as a history full of quick push would be useless.

Anderson - Thanks for pointing that out. I copied it from the softreset and didn't update it. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment