Last active
August 29, 2015 14:00
-
-
Save ebinnion/11278400 to your computer and use it in GitHub Desktop.
Gist of helpful commands that I use in development.
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
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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. :/