Skip to content

Instantly share code, notes, and snippets.

@alunny
Created November 26, 2010 22:22
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alunny/717284 to your computer and use it in GitHub Desktop.
Save alunny/717284 to your computer and use it in GitHub Desktop.
my git configuration

My Git Configuration

For best results, use hub and git bash completion (included with git under contrib/completion).

#! /bin/sh
alias git=hub
alias g=git
# aliases
git config --global alias.s "status -sb"
git config --global alias.d diff
git config --global alias.wd "diff --word-diff"
git config --global alias.a add
git config --global alias.cm commit
git config --global alias.ca "commit -a"
git config --global alias.co checkout
git config --global alias.rb rebase
git config --global alias.br branch
git config --global alias.ph push
git config --global alias.pl pull
git config --global alias.l "log --oneline --decorate"
git config --global alias.f fetch
git config --global alias.am "commit -a --amend"
git config --global alias.delete-remote '!sh -c "git push \$0 \:\$1"'
git config --global alias.r remote
git config --global alias.rv "remote -v"
git config --global alias.aliases "!git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'"
# colors
git config --global color.ui auto
# deal with windows file
git config --global core.autocrlf input
function gpm {
for REMOTE in "$@"
do
g ph $REMOTE master
done
}
# ignore changes to a file in the working tree
function gi {
git update-index --assume-unchanged $*
}
# update and init
function gsbm {
git submodule update --init
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment