Created
February 3, 2022 05:11
-
-
Save hhenrichsen/fef48f2a318e20da95da0c9adde1fb34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
co = checkout | |
s = status | |
c = commit | |
unstage = restore --staged -- | |
pf = push --force-with-lease | |
new-branch = !git fetch -p && git stash push --include-untracked && git checkout master && git pull && git checkout -b \"$USER-$1\" && : | |
current-branch = branch --show-current | |
new-user-branch = !git fetch -p && git stash push --include-untracked && git checkout master && git pull && git checkout -b \"$USER-$1\" && : | |
# oldest-ancestor from https://stackoverflow.com/a/4991675 | |
oldest-ancestor = !bash -c 'diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | head -1' - | |
rb = rebase --interactive --autosquash | |
auto-rebase = !git rb $(git oldest-ancestor) | |
changes-in = !git --no-pager show --stat --oneline --name-only $1 | tail -n +2 && : | |
changed-files = !git --no-pager show --stat --oneline --name-only $1 | tail -n +2 && : | |
fixup-existing = !git changed-files $1 | xargs -d \"\\n\" git add && git fx $1 && : | |
fixup = !git commit --fixup=$1 && : | |
fx = fixup | |
fxe = fixup-existing | |
nub = new-user-branch | |
nb = new-branch | |
[push] | |
default = current |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment