Push branch does not respect branch `pushRemote` config option
Closed this issue · 3 comments
When pushing a branch to a remote, the default remote should respect the settings in the [branch <name>] section of the git config file. Currently, branch push defaults to remote in this section. However, if pushRemote is present this should take priority over remote. But SourceGit does not currently follow this behavior. git push and git pull , without specifying the remote, CLI commands follow the expected behavior.
It feels inconsistent to me that the defaults of the GUI app do not follow the same default behavior of the git CLI.
For example, my typical setup for main is:
[branch "main"]
remote = upstream
pushRemote = origin
merge = refs/heads/master
From the command line, git pull will pull changes from upstream, and git push will push to origin. This way I can quickly sync my main branch.
Edit: Edited the description of the issue for clarity.
This configuration seems to exist since git 1.x, but there is not much git client support. I tested GitKraken, IDEA, and VSCode, and they all ignored this configuration.
@love-linger TY for the workaround.
@gadfly3173 I used this configuration with Atlassian SourceTree.

