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:
parent
2d17a75972
commit
c190b10e31
1 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
function gm
|
function gm
|
||||||
|
if count $argv >/dev/null
|
||||||
git merge $argv
|
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
|
||||||
|
|
Loading…
Reference in a new issue