diff --git a/.config/git/config.inc/common.gitconfig b/.config/git/config.inc/common.gitconfig index 5d3c504..bfe6e16 100644 --- a/.config/git/config.inc/common.gitconfig +++ b/.config/git/config.inc/common.gitconfig @@ -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