Skip to content

@trumbitta /.bash_aliases forked from henrik/.bashrc
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
My version with tweaks and inspiration from holman/dotfiles
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
alias git=hub
alias gis="git status"
alias gits="git status"
alias gitp="git pull"
alias safepull="git stash && git pull && git stash apply"
alias dspurge="sudo find . -name \".DS_Store\" -depth -exec rm {} \;"
alias gituserme='git config user.name "William Ghelfi" && git config user.email trumbitta@gmail.com && cat .git/config | grep -C2 "[user]"'
alias gituserwilliam='git config user.name "William Ghelfi" && git config user.email william@williamghelfi.com && cat .git/config | grep -C2 "[user]"'
# 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$ '
[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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.