From 45d8e0ddbb9c7f5fd9d59ca4b2094c70e203c107 Mon Sep 17 00:00:00 2001 From: Thanasis Polychronakis Date: Wed, 7 May 2014 13:09:20 +0200 Subject: .gitconfig: Make sure `go` never overrides branches Closes #357. Thanks to @yukideluxe! --- .gitconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.gitconfig') diff --git a/.gitconfig b/.gitconfig index b14b609..a586fd0 100644 --- a/.gitconfig +++ b/.gitconfig @@ -14,7 +14,7 @@ # Commit all changes ca = !git add -A && git commit -av # Switch to a branch, creating it if necessary - go = checkout -B + go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" # Show verbose output about tags, branches or remotes tags = tag -l branches = branch -a -- cgit v1.2.3