.dotfiles/.config/fish/functions/grename.fish
2024-10-21 20:46:27 +03:00

11 lines
346 B
Fish

function grename -d "Rename 'old' branch to 'new', including in origin remote" -a old new
if test (count $argv) -ne 2
echo "Usage: "(status -u)" old_branch new_branch"
return 1
end
git branch -m $old $new
git push origin :$old
and git push --set-upstream origin $new
end
complete -c grename -x -a "(complete -C 'git branch ')"