gitconfig: Add aliases push-softly, stash-bttf, rebase-c

This commit is contained in:
Lexi / Zoe 2026-04-08 13:47:23 +02:00
parent 695985746e
commit f1c6dceb42
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232

View file

@ -67,12 +67,20 @@
# Push with ci.skip option (probably only works with GitLab)
push-skip-ci = push -o ci.skip
# Push with --force-with-lease, like force push but less risky. Should be used after a rebase.
push-softly = push --force-with-lease
# "back to the future": switch to default branch and pull
# TODO: Add `git stash push/pop`, but only if there actually is something to stash... not quite sure how
bttf = "!f() { DEFAULT=$(git default-branch); git switch ${1-$DEFAULT} && git pull --rebase --prune; }; f"
stash-bttf = !git stash && git bttf && git stash pop
# Reset HEAD to last commit, but keep files as they are
uncommit = reset HEAD~1 --mixed
# Shortcut for rebase --continue
rebase-c = rebase --continue
# Stash changes, pull and pop stash again
stash-pull = !git stash && git pull && git stash pop