Skip to content

Instantly share code, notes, and snippets.

@craigbeck
Last active August 29, 2015 14:19
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 craigbeck/39c4492e9d400b240109 to your computer and use it in GitHub Desktop.
Save craigbeck/39c4492e9d400b240109 to your computer and use it in GitHub Desktop.
Quick profile setup
# aliases
alias cls='clear'
alias ls='ls -FG'
alias ll='ls -l'
alias la='ll -a'
# git completion
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
. `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi
# fancy git-aware prompt
export PS1="\$(if [[ \$? == 0 ]]; then echo \"\[\033[01;32m\]\342\234\223\"; else echo \"\[\033[01;31m\]\342\234\227\"; fi) \e[32;1m\]\w \[\e[0m\]\`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\\\\\*\ \(.+\)$/\(\\\\\\\\\1\)\/\`\[\033[00m\]\[\033[37m\]\[\033[00m\]\n$ "
# add this to your .gitconfig file in your home directory
[alias]
co = checkout
st = status
ci = commit
br = branch
ai = add --interactive
amend = commit --amend
hist = log --pretty=format:\"%C(yellow)%h %Cred%ad %Creset| %s%d %Cblue[%an]\" --graph --date=short --decorate
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment