Skip to content

Instantly share code, notes, and snippets.

@jklue
Created February 20, 2018 21:09
Show Gist options
  • Save jklue/e1d462c554e340e392f3b7269f00b412 to your computer and use it in GitHub Desktop.
Save jklue/e1d462c554e340e392f3b7269f00b412 to your computer and use it in GitHub Desktop.
pretty bash
# prompt
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\033[0;32m"
NO_COLOR="\[\033[0m\]"
NC="\033[0m"
PS1="\[\e[36;1m\]\w \[\e[00m\]$YELLOW\$(parse_git_branch)$NO_COLOR\$ "
# helpers
alias ll="ls -lahG"
# git
alias gitconfig="subl .git/config"
alias status="git status"
alias add="git add --all"
alias commit="git commit -m"
alias push="git push"
alias initialpush="git push --set-upstream origin master"
alias pull="git pull"
alias branch="git branch"
alias b="git branch"
alias s="status"
function sg() {
git add .
git commit -a -m "$1"
git push
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment