summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkkard2 <[email protected]>2026-01-16 09:26:10 +0100
committerkkard2 <[email protected]>2026-01-16 09:26:10 +0100
commita1b2c814e43161401889d7e0abdea2f46c7ed0ef (patch)
tree7a20f71f5f44b059e3112e54d56a5ee251808ad3
parent3f00c41f088518da0f22e96b4425df2c642237e9 (diff)
better sw
-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