aboutsummaryrefslogtreecommitdiffstats
path: root/.gitconfig
diff options
context:
space:
mode:
authorThanasis Polychronakis <thanpolas@gmail.com>2014-05-07 13:09:20 +0200
committerMathias Bynens <mathias@qiwi.be>2014-05-07 15:04:55 +0200
commit45d8e0ddbb9c7f5fd9d59ca4b2094c70e203c107 (patch)
tree8f28af69d1b3eb6d4f2880e3969865c7401817e6 /.gitconfig
parenta231822cddd79300fe9629e6204eb83f0f939053 (diff)
downloaddotfiles-45d8e0ddbb9c7f5fd9d59ca4b2094c70e203c107.tar.gz
dotfiles-45d8e0ddbb9c7f5fd9d59ca4b2094c70e203c107.tar.bz2
dotfiles-45d8e0ddbb9c7f5fd9d59ca4b2094c70e203c107.zip
.gitconfig: Make sure `go` never overrides branches
Closes #357. Thanks to @yukideluxe!
Diffstat (limited to '.gitconfig')
-rw-r--r--.gitconfig2
1 files changed, 1 insertions, 1 deletions
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