Created
August 31, 2010 08:01
-
-
Save lautis/558704 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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