From 3eb6de2c89da2c0e831eb150cfdea2e4acaaf885 Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Fri, 22 May 2026 11:49:26 -0400 Subject: [PATCH] Add new shell alias/function for rebasing on default branch --- modules/shared/home/general/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/shared/home/general/default.nix b/modules/shared/home/general/default.nix index 1395417..7fc6b4e 100644 --- a/modules/shared/home/general/default.nix +++ b/modules/shared/home/general/default.nix @@ -276,6 +276,20 @@ fi export GPG_TTY=$(tty) + + # gfr = git fetch rebase and functions on default branch + gfr() { + local default_branch + default_branch=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@') + + if [ -z "$default_branch" ]; then + echo "Error: Default branch not found. Run 'git remote set-head origin -a' first." + return 1 + fi + + git fetch origin "$default_branch":"$default_branch" && git rebase "$default_branch" + } + function nv() { # Assumes all configs exist in directories named ~/.config/nvim-* local config=$(fd --max-depth 1 --glob 'nvim*' ~/.config | fzf --prompt="Neovim Configs > " --height=~50% --layout=reverse --border --exit-0)