Skip to content

Instantly share code, notes, and snippets.

@lautis
Created August 31, 2010 08:01
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 lautis/558704 to your computer and use it in GitHub Desktop.
Save lautis/558704 to your computer and use it in GitHub Desktop.
git_set() {
/usr/bin/env git config --global $@
}
git_ignore() {
if grep "^$1$" $HOME/.gitignore; then
return
fi
echo $1 >> $HOME/.gitignore
}
# Colors
git_set color.diff auto
git_set color.status auto
git_set color.branch auto
git_set color.interactive auto
# Global exludes
git_set core.excludesfile "$HOME/.gitignore"
touch $HOME/.gitignore
git_ignore \.DS_Store
git_ignore \*~
git_ignore \*\.o
git_ignore \*\.so
git_ignore \*\.log
# Git push to push only current branch (to its tracking branch)
git_set push.default tracking
# Merge
git_set merge.log true
git_set branch.master.mergeoptions "--no-ff"
# Git branch should set up tracking branches and use rebase instead of merge
git_set branch.autosetupmerge true
git_set branch.autosetuprebase remote
# Aliases
/usr/bin/env git config --global alias.lg "log --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment