public
Last active — forked from henrik/.bashrc

My version with tweaks and inspiration from holman/dotfiles

  • Download Gist
.bashrc
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
 
function parse_git_unpushed {
local unpushed=`/usr/bin/git cherry -v origin/$(get_git_branch)`
[[ "$unpushed" != "" ]] && echo "$(tput setaf 1) ++> $(tput sgr0)"
}
 
function parse_git_dirty {
git diff --quiet HEAD &>/dev/null
[[ $? == 1 ]] && echo " $(tput bold)$(tput setaf 3)*$(tput sgr0)"
}
 
function get_git_branch {
echo $(__git_ps1 "%s")
}
 
function parse_git_branch {
local branch=$(get_git_branch)
[[ $branch ]] && echo "[$(tput setaf 6)$branch$(tput sgr0)$(parse_git_dirty)]$(parse_git_unpushed)"
}
 
PS1='${debian_chroot:+($debian_chroot)}\u@\h \w$(parse_git_branch)\n$ '
.gitconfig
INI
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
[user]
name = William Ghelfi
email = my@email.it
[github]
user = username
token = xyzverylong
[alias]
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[core]
excludesfile = /home/user/.gitignore_global

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.