Last active
March 11, 2016 06:53
-
-
Save lulalachen/76f1e1ff964ab144f4b8 to your computer and use it in GitHub Desktop.
Useful 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
# ~/.aliases | |
# Put alias under this file | |
## Directory | |
alias wk="cd ~/Documents/workspace" | |
## Alias | |
alias sourcealias="source ~/.zshrc" # source new alias | |
alias newalias="createAlias && sourcealias" # eg: $newalias goToHomeAndSayHello "cd ~ && echo 'hello'" | |
createAlias() { | |
echo "alias $1=\"$2\"" | cat - ~/.aliases > temp && mv temp ~/.aliases | |
} | |
## Git | |
alias gl="git log --oneline" | |
alias gs="git status" | |
alias gp="git pull" | |
alias gd="git checkout develop" | |
alias nt="gd && git pull" | |
alias rebaseToDevelop="nt && gco @{-1} && git rebase develop" | |
alias rebasePrevious=rebaseHEAD | |
rebaseHEAD() { | |
git rebase -i HEAD~"$1" | |
} | |
## npm development | |
alias go="npm run watch" | |
alias gotest="npm run test:watch" |
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
# ~/.zshrc or ~/.bashrc | |
if [ -f $HOME/.aliases ]; then | |
. $HOME/.aliases | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment