Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Git setup niceties
# via https://gist.github.com/419201#file_gitconfig.bash
# Install (from Matt's gist) these useful Git aliases & configurations with the following command:
# $ bash <(curl -s https://raw.github.com/gist/419201/gitconfig.bash)
git config --global color.ui auto # colorize output (Git 1.5.5 or later)
git config --global color.interactive auto # and from 1.5.4 onwards, this will works:
echo "Set your name & email to be added to your commits."
echo -n "Please enter your name: "
read git_name
echo -n "Please enter your email: "
read git_email
git config --global user.name "$git_name"
git config --global user.email "$git_email"
unset git_name
unset git_email
git config --global core.excludesfile ~/.gitignore
git config --global rerere.enabled 1
git config --global branch.master.remote origin
git config --global branch.master.merge refs/heads/master
git config --global alias.br branch
git config --global alias.ci "commit -a"
git config --global alias.co checkout
git config --global alias.df diff
git config --global alias.dwc "diff -w -M --color-words"
git config --global alias.lg log
git config --global alias.ll "log -p"
git config --global alias.rb rebase
git config --global alias.fix "rebase -i origin/master"
git config --global alias.rbc "rebase --continue"
git config --global alias.re remote
git config --global alias.st status
git config --global alias.tree "log --graph --decorate --pretty=oneline --abbrev-commit"
git config --global alias.up "pull --rebase"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment