-
-
Save kgn/760788 to your computer and use it in GitHub Desktop.
My user setup
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
[alias] | |
cl = clone --recursive | |
un = reset --hard | |
st = status -s | |
aa = add --all | |
ci = commit -m | |
co = checkout | |
cob = checkout -b | |
br = branch | |
rbr = branch -r | |
rmrb = push --delete origin # delete a remote branch | |
rp = remote prune origin # cleanup stale remote branch refs | |
pr = pull --rebase | |
ms = merge --squash | |
sub = submodule add | |
subup = submodule update --init --recursive | |
subeach = submodule foreach --recursive | |
dft = difftool | |
lg = log --graph --format='%C(red)%h%C(reset) -%C(yellow)%d%C(reset) %s \ | |
%C(green)(%cr) %C(bold blue)<%an>%C(reset)' --date=relative | |
[core] | |
quotepath = false | |
[color] | |
diff = auto | |
status = auto | |
branch = auto |
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
alias subl='open -a "Sublime Text"' | |
# Inspired by: http://henrik.nyh.se/2008/12/git-dirty-prompt | |
function parse_git_dirty { | |
[[ $(git status -s 2> /dev/null | sed 's/^ *//;s/ *$//') != '' ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/($(parse_git_dirty)\1)/" | |
} | |
# username@machine[dir](master)$ # clean working directory | |
# username@machine[dir](*master)$ # dirty working directory | |
export PS1='\u@\h[$(basename "${PWD}")]$(parse_git_branch)\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment