Skip to content

Instantly share code, notes, and snippets.

@psachin
Forked from ralfebert/.bashrc
Created January 18, 2012 06:13
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 psachin/1631398 to your computer and use it in GitHub Desktop.
Save psachin/1631398 to your computer and use it in GitHub Desktop.
git settings
# Prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[31;38m\]\u@\h\[\033[00m\]:\[\033[31;38m\]\w\[\033[1;31m\]\$(parse_git_branch)\[\033[00m\] "
# Editor
export GIT_EDITOR='nano -Y patch'
# Shortcuts
# Creates git repostitory with some reasonable default settings in current folder
function git_here() {
git init
git config color.ui auto
echo "log tmp db/*.sqlite3 nbproject/private bin .DS_Store" | tr " " "\n" > .gitignore
git add .gitignore
git commit -m "initial project setup"
}
alias d='git diff --word-diff $@'
alias s='d;git status -sb'
alias b='git branch -avv'
alias a='git add $@'
alias c='git commit -v $@'
alias ac='git add .;c $@'
alias lg='git lg'
git config --global alias.lg "log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr %an)%Creset' --abbrev-commit --date=relative"
git config --global alias.wipe '!git reset --hard;git clean -fd'
git config --global color.ui auto
git config --global core.editor "nano -Y patch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment