You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
push.default = upstream is only necessary when the remote branch name differs from the local branch name. Otherwise, simple is much more ergonomic.
upstream leads to weird behaviour if there are multiple remotes. The problem is that only one remote can be the one with the upstream branch. Pushing to others without an explicit remote branch leads to the following error:
--- [origin] ---
fatal: You are pushing to remote 'origin', which is not the upstream of
your current branch 'develop', without telling me what to push
to update which remote branch.
It might make sense to print a warning in that case (multiple remotes with branch naming mismatch), which should be rare enough.
Currently, push.default is just set during worktree init/clone/conversion. In the future, this would also need to be done during each sync, as the number of remotes may change and the setting may have to be changed accordingly.
Also, the setting is currently repo-specific. But actually, it would be worktree-specific. Some worktrees might match the remote branch (master/main/develop being common), while others may not (I like to use a prefix with feature branches for example). Only the latter should use push.default = upstream when using multiple remotes.
The text was updated successfully, but these errors were encountered:
push.default = upstream
is only necessary when the remote branch name differs from the local branch name. Otherwise,simple
is much more ergonomic.upstream
leads to weird behaviour if there are multiple remotes. The problem is that only one remote can be the one with the upstream branch. Pushing to others without an explicit remote branch leads to the following error:It might make sense to print a warning in that case (multiple remotes with branch naming mismatch), which should be rare enough.
Currently,
push.default
is just set during worktree init/clone/conversion. In the future, this would also need to be done during eachsync
, as the number of remotes may change and the setting may have to be changed accordingly.Also, the setting is currently repo-specific. But actually, it would be worktree-specific. Some worktrees might match the remote branch (
master
/main
/develop
being common), while others may not (I like to use a prefix with feature branches for example). Only the latter should usepush.default = upstream
when using multiple remotes.The text was updated successfully, but these errors were encountered: