Commit f6ff8b722897
Changed files (1)
dots
config
lazygit
dots/config/lazygit/config.yml
@@ -39,11 +39,11 @@ keybinding:
select: "s"
customCommands:
- # Sync: fetch + rebase + push current branch
+ # Sync: fetch all + rebase (from upstream if exists, else origin) + push
- key: ";"
description: "Sync Pull/Push"
context: "global"
- command: "git fetch {{.CheckedOutBranch.UpstreamRemote}} && git rebase {{.CheckedOutBranch.UpstreamRemote}}/{{.CheckedOutBranch.Name}} && git push {{.CheckedOutBranch.UpstreamRemote}} {{.CheckedOutBranch.Name}}"
+ command: "git fetch --all && REBASE_REMOTE=$(git remote | grep -q upstream && echo upstream || echo origin) && git rebase $REBASE_REMOTE/{{.CheckedOutBranch.Name}} && git push origin {{.CheckedOutBranch.Name}}"
loadingText: "Syncing...."
output: popup