mirror of
https://github.com/genebean/dots.git
synced 2026-05-30 23:35:22 -04:00
Add new shell alias/function for rebasing on default branch
This commit is contained in:
parent
4cb1f9b39f
commit
3eb6de2c89
1 changed files with 14 additions and 0 deletions
|
|
@ -276,6 +276,20 @@
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export GPG_TTY=$(tty)
|
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() {
|
function nv() {
|
||||||
# Assumes all configs exist in directories named ~/.config/nvim-*
|
# 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)
|
local config=$(fd --max-depth 1 --glob 'nvim*' ~/.config | fzf --prompt="Neovim Configs > " --height=~50% --layout=reverse --border --exit-0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue