Repository navigation
push: suggest remote.pushDefault when "simple" refuses to push - #2467
Draft
HaraldNordgren wants to merge 1 commit into
Draft
HaraldNordgren wants to merge 1 commit into
HaraldNordgren wants to merge 1 commit into
Conversation
HaraldNordgren
force-pushed
the
push-simple-pushdefault-hint
branch
4 times, most recently
from
October 23, 2026 11:47
84368bd to
bb77452
Compare
HaraldNordgren
marked this pull request as draft
October 23, 2026 11:48
After cloning a project and adding a fork as a second remote, a branch started from "origin/main" cannot be pushed with a plain "git push" while push.default is left at "simple", because its upstream branch has a different name. The advice offers to push to the upstream branch, or to a branch of the same name on "origin". Both go to the project's repository, which someone working in a fork usually cannot push to. The usual way out, "git push -u" to the fork, moves the upstream there, so the branch is no longer compared with the project's branch. Setting remote.pushDefault to the fork makes a plain "git push" go to a branch of the same name there, and leaves the upstream alone. When the repository has another remote, show how to push to it, and how to make that the default with remote.pushDefault. With more than one other remote, show "<remote>" in place of a name. Show it in place of the advice to set branch.autoSetupMerge to "simple". That setting would leave a branch started from "origin/main" without an upstream, and with it the comparison with the project's branch. Do not show it when remote.pushDefault or branch.<name>.pushRemote is already set. The push then went to this remote on purpose, as in a trunk-based setup where every branch is pushed to the one remote. Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
HaraldNordgren
force-pushed
the
push-simple-pushdefault-hint
branch
from
October 23, 2026 16:56
bb77452 to
2c59c7a
Compare
|
Im new at sime but im take from data past away to rebuilt generation future |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After cloning a project and adding a fork, a branch started from
origin/maincannot be pushed with a plaingit pushunder the defaultpush.default=simple, and the advice only offers ways to push toorigin. When the repository has another remote, also show how to push there and how to make that the default: