summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2021-05-15 15:48:48 -0500
committerToby Vincent <tobyv13@gmail.com>2021-05-15 15:48:48 -0500
commitca35d123bea507d9c458c559ccdcfe2a9b9786d8 (patch)
tree773a4c5cad0f2ef203dff0d35af4527d09ebce07
parentd34462b9469965f62db2fbff01f8f8c96938b394 (diff)
feat: added git alias for branch rename
-rw-r--r--gitconfig3
1 files changed, 3 insertions, 0 deletions
diff --git a/gitconfig b/gitconfig
index 2581396..7745824 100644
--- a/gitconfig
+++ b/gitconfig
@@ -47,6 +47,9 @@ ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [a:%an,c:%cn]"
# undo http://megakemp.com/2016/08/25/git-undo/
undo = "!f() { git reset --soft $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f"
+# rename branch
+brn = "!f() { git branch -m \"$(git rev-parse --abbrev-ref HEAD)\" $1; git fetch origin; git branch -u origin/$1 $1; git remote set-head origin -a; }; f"
+
# grep on filename
f = "!git ls-files | grep -i"