Skip to content

Instantly share code, notes, and snippets.

@jamesmorrison
Last active August 15, 2018 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmorrison/ac164c09ac2ca51545a0bc27ebceb8cf to your computer and use it in GitHub Desktop.
Save jamesmorrison/ac164c09ac2ca51545a0bc27ebceb8cf to your computer and use it in GitHub Desktop.
## CMD PROMPT
green=$(tput setaf 2)
blue=$(tput setaf 4)
white=$(tput setaf 7)
bold=$(tput bold)
reset=$(tput sgr0)
PS1='${debian_chroot:+($debian_chroot)}\[$green\]MAC\[$reset\]:\[$white\]\w\[$reset\]\[$green\]$(parse_git_branch)\[$reset\]\$ '
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
unset color_prompt force_color_prompt
## Mac Aliases
alias hosts="sudo nano /private/etc/hosts && dscacheutil -flushcache"
alias clear-history="history -c && history -w"
## Git Aliases
alias ga='git add .'
alias gb='git branch'
alias gba="git branch | grep '^*' | sed 's/* //'";
alias gc='git commit -m'
alias gp="git pull origin $(git branch | grep '^*' | sed 's/* //') && git push origin $(git branch | grep '^*' | sed 's/* //')"
alias gpom='git pull origin master && git push origin master'
alias gr='git remote -v'
alias gs='git status'
alias gsub="git submodule update --init --recursive && git submodule foreach --recursive git fetch --tags"
alias gt='git tag'
## Vagrant Aliases
alias v='vagrant'
alias vd='vagrant destroy'
alias vh='vagrant halt'
alias vp='vagrant up --provision'
alias vr='vagrant reload'
alias vs='vagrant ssh'
alias vst='vagrant status'
alias vu='vagrant up'
## PATH
export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/bin:$PATH"
export PATH="~/Library/Python/3.6/bin:$PATH"
export PATH="$HOME/.composer/vendor/bin:$PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment