summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--global_gitconfig2
1 files changed, 1 insertions, 1 deletions
diff --git a/global_gitconfig b/global_gitconfig
index 26b0065..c61577b 100644
--- a/global_gitconfig
+++ b/global_gitconfig
@@ -7,7 +7,7 @@
bd = branch -d
cb = checkout -b
check = checkout
- sw = switch
+ sw = "!f(){ b=$(git for-each-ref --format='%(refname:short)' refs/heads refs/remotes | grep -E '(^|/)'\"$1\" | head -n1); [ -z \"$b\" ] && echo \"No branch matching $1\" && exit 1; git switch \"${b#origin/}\"; }; f"
cm = commit -m
al = config --get-regexp alias
pushup = push --set-upstream origin