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.
This commit is contained in:
Sanchayan Maity 2023-01-11 16:38:14 +05:30
parent 2d17a75972
commit c190b10e31
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3

View file

@ -1,3 +1,8 @@
function gm function gm
git merge $argv 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 end