Permalink
Browse files

save user gitconfig when it's not g2

  • Loading branch information...
1 parent 14ca1aa commit 1214b19d0dab9aefb14b9f57870d5392a53fd6cf @orefalo committed Jun 21, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 g2-config.sh
View
4 g2-config.sh
@@ -53,7 +53,9 @@ LOCKFILE=$(which lockfile)
[[ -n $LOCKFILE ]] && lockfile -2 -r 3 /tmp/git-config.lock
save_config
-test -f ~/.gitconfig && mv -f ~/.gitconfig ~/.gitconfig.pre-g2
+[[ -f ~/.gitconfig && $(grep "#G2 - https://github.com/orefalo/g2" ~/.gitconfig | wc -l ) -eq 0 ]] && mv -f ~/.gitconfig ~/.gitconfig.pre-g2
+
+echo "#G2 - https://github.com/orefalo/g2" > ~/.gitconfig
apply_config
$GIT_EXE config --global core.excludesfile ~/.gitignore_global

0 comments on commit 1214b19

Please sign in to comment.