dotfiles/fish/.config/fish/functions/gm.fish
Sanchayan Maity c190b10e31
fish: functions/gm: Automatically detect master or main and merge
git merge master/main is a frequent enough operation. Automatically
detect whether the primary branch is master or main and merge.
2023-01-12 18:39:37 +05:30

9 lines
211 B
Fish

function gm
if count $argv >/dev/null
git merge $argv
else
set -l remote (git symbolic-ref refs/remotes/origin/HEAD | awk -F'/' '{print $4}')
git merge origin/$remote
end
end