Skip to content
Snippets Groups Projects
Commit fabc83c6 authored by nimrod's avatar nimrod
Browse files

Some Git workflow improvements.

- Alias to get the default branch (like master, main, dev).
- Alias to update the default branch from the origin remote.
- Fix the remaster alias (to rebase on the updated default branch).
parent d54fb543
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@
cdiff = diff --cached
cleaan = clean -dX
cleaaan = clean -dx
default-branch = !git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f2
dif = diff --color-words
empty-commit = commit --allow-empty
exec = "!${SHELL:-/bin/sh} -ic "
......@@ -16,6 +17,7 @@
fixup = !cd "${GIT_PREFIX:-$PWD}" && git commit --fixup $(git last-commit)
forget = reset HEAD^
iec = commit --allow-empty --only --message \"Initial empty commit.\"
master = !git fetch --progress --tags "${1:-origin}" "$(git default-branch):$(git default-branch)"
merg = merge --no-edit
pop = stash pop
posh = push --set-upstream origin HEAD
......@@ -23,7 +25,7 @@
Pull = pull --progress --ff --tags
pull-force = !git fetch && git reset --hard "$(git tracking)"
pushes = !git remote | xargs -n1 git push
remaster = !git fetch --all && git autorebase origin/master
remaster = !git master && git autorebase "$(git default-branch)"
rerebase = !git autorebase "$(git tracking)"
retry = !cd "${GIT_PREFIX:-$PWD}" && git amend --no-edit . && git shove
root = rev-parse --show-toplevel
......
#!/bin/sh
set -eu
git checkout "$(git config init.defaultBranch)"
git pull --progress --ff --tags
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment