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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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

Documents/bin/git-newday

deleted100755 → 0
+0 −5
Original line number Diff line number Diff line
#!/bin/sh
set -eu

git checkout "$(git config init.defaultBranch)"
git pull --progress --ff --tags