<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-push.adoc, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-03-25T19:35:16Z</updated>
<entry>
<title>push: support pushing to a remote group</title>
<updated>2026-03-25T19:35:16Z</updated>
<author>
<name>Usman Akinyemi</name>
<email>usmanakinyemi202@gmail.com</email>
</author>
<published>2026-03-25T19:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aac9bf095f1a3f1e7cdc74c6d4e537f671b93a5f'/>
<id>urn:sha1:aac9bf095f1a3f1e7cdc74c6d4e537f671b93a5f</id>
<content type='text'>
`git fetch` accepts a remote group name (configured via `remotes.&lt;name&gt;`
in config) and fetches from each member remote. `git push` has no
equivalent — it only accepts a single remote name.

Teach `git push` to resolve its repository argument through
`add_remote_or_group()`, which was made public in the previous patch,
so that a user can push to all remotes in a group with:

    git push &lt;group&gt;

When the argument resolves to a single remote, the behaviour is
identical to before. When it resolves to a group, each member remote
is pushed in sequence.

The group push path rebuilds the refspec list (`rs`) from scratch for
each member remote so that per-remote push mappings configured via
`remote.&lt;name&gt;.push` are resolved correctly against each specific
remote. Without this, refspec entries would accumulate across iterations
and each subsequent remote would receive a growing list of duplicated
entries.

Mirror detection (`remote-&gt;mirror`) is also evaluated per remote using
a copy of the flags, so that a mirror remote in the group cannot set
TRANSPORT_PUSH_FORCE on subsequent non-mirror remotes in the same group.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Usman Akinyemi &lt;usmanakinyemi202@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: convert git push to synopsis style</title>
<updated>2025-11-19T23:00:45Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2025-11-19T21:40:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f7316a66d36f39ed9e5be7a3ce0ecd7b71430ff5'/>
<id>urn:sha1:f7316a66d36f39ed9e5be7a3ce0ecd7b71430ff5</id>
<content type='text'>
- Switch the synopsis to a synopsis block which will automatically
  format placeholders in italics and keywords in monospace
- Use _&lt;placeholder&gt;_ instead of &lt;placeholder&gt; in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'je/doc-push-upstream'</title>
<updated>2025-10-14T19:56:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-10-14T19:56:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1003719fb700df37557d6d161e757fabb952e78a'/>
<id>urn:sha1:1003719fb700df37557d6d161e757fabb952e78a</id>
<content type='text'>
Documentation updates.

* je/doc-push-upstream:
  doc: git-push: add explanation of `git push origin main`
  doc: git-push: clarify "what to push"
  doc: git-push: clarify "where to push"
  doc: add an UPSTREAM BRANCHES section to pull/push/fetch
  doc: git-push: clarify intro
</content>
</entry>
<entry>
<title>doc: git-push: add explanation of `git push origin main`</title>
<updated>2025-10-06T21:30:34Z</updated>
<author>
<name>Julia Evans</name>
<email>julia@jvns.ca</email>
</author>
<published>2025-10-06T18:58:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a72504fe051272227f4097e8d664a9b7d871ec25'/>
<id>urn:sha1:a72504fe051272227f4097e8d664a9b7d871ec25</id>
<content type='text'>
What happens if you run `git push` without any arguments is actually
extremely complex to explain, as discussed in the previous commit.

But it's very easy to explain what `git push &lt;remote&gt; &lt;branch&gt;` does, so
start the man page by explaining what that does.

The hope is that someone could just stop reading the man page here and
never learn anything else about `git push`, and that would be fine.

Signed-off-by: Julia Evans &lt;julia@jvns.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: git-push: clarify "what to push"</title>
<updated>2025-10-06T21:29:49Z</updated>
<author>
<name>Julia Evans</name>
<email>julia@jvns.ca</email>
</author>
<published>2025-10-06T18:58:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e1688f1f462d7a704bbcc1dae612488b7ac6e29'/>
<id>urn:sha1:6e1688f1f462d7a704bbcc1dae612488b7ac6e29</id>
<content type='text'>
From user feedback: 6 users says they found the "what to push"
paragraphs confusing, for many different reasons, including:

* what does "..." in &lt;refspec&gt;... mean?
* "consult XXX configuration" is hard to parse
* it refers to the `git-config` man page even though the config
  information for `git push` is included in this man page under
  CONFIGURATION
* the default ("push to a branch with the same name") is what they use
  99% of the time, they would have expected it to appear earlier instead
  of at the very end
* not understanding what the term "upstream" means in Git
  ("are branches tracked by some system besides their names?"")

Also, the current explanation of `push.default=simple` ("the
current branch is pushed to the corresponding upstream branch, but
as a safety measure, the push is aborted if the upstream branch
does not have the same  name as the local one.") is not accurate:
`push.default=simple` does not always require you to set a corresponding
upstream branch.

Address all of these by

* using a numbered "in order of precedence" list
* giving a more accurate explanation of how `push.default=simple` works
* giving a little bit of context around "upstream branch": it's
  something that you may have to set explicitly
* referring to the new UPSTREAM BRANCHES section

The default behaviour is still discussed pretty late but it should be
easier to skim now to get to the relevant information.

In "`git push` may fail if...",  I'm intentionally being vague about
what exactly `git push` does, because (as discussed on the mailing list)
the behaviour of `push.default=simple` is very confusing, perhaps broken,
and certainly not worth trying to explain in an introductory context.
`push.default.simple` sometimes requires you to set an upstream and
sometimes doesn't and the exact conditions under which it does/doesn't
are hard to describe.

Signed-off-by: Julia Evans &lt;julia@jvns.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: git-push: clarify "where to push"</title>
<updated>2025-10-06T21:29:49Z</updated>
<author>
<name>Julia Evans</name>
<email>julia@jvns.ca</email>
</author>
<published>2025-10-06T18:58:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3856d8937817c6815ecabaa3a927fc2e124e8155'/>
<id>urn:sha1:3856d8937817c6815ecabaa3a927fc2e124e8155</id>
<content type='text'>
It's not obvious that "`branch.*.remote` configuration"` refers to the
upstream, so say "upstream" instead.

The sentence is also quite hard to parse right now, use "defaults to" to
simplify it.

Signed-off-by: Julia Evans &lt;julia@jvns.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: git-push: clarify intro</title>
<updated>2025-10-06T21:29:48Z</updated>
<author>
<name>Julia Evans</name>
<email>julia@jvns.ca</email>
</author>
<published>2025-10-06T18:58:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5b696cb390385f4906df411be917ef0a7b92ebb7'/>
<id>urn:sha1:5b696cb390385f4906df411be917ef0a7b92ebb7</id>
<content type='text'>
From user feedback, 5 users are unsure what "ref" and/or "objects" means
in this context. 3 users said they don't know what "complete the refs"
means.

Many users also commented that receive hooks do not seem like the most
important thing to know about `git push`, and that this information
should not be the second sentence in the man page.

Use more familiar language to make it more accessible to users who do
not know what a "ref" is and move the "hooks" comment to the end.

Signed-off-by: Julia Evans &lt;julia@jvns.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: git-push: rewrite refspec specification</title>
<updated>2025-09-24T19:29:34Z</updated>
<author>
<name>Julia Evans</name>
<email>julia@jvns.ca</email>
</author>
<published>2025-09-23T18:10:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=657586a5a6ddfa1d6c732b8b0f4670d198a4be02'/>
<id>urn:sha1:657586a5a6ddfa1d6c732b8b0f4670d198a4be02</id>
<content type='text'>
From user feedback, there was a request for examples, as well as a
comment that one person found "If git push [&lt;repository&gt;] without
any &lt;refspec&gt; argument is set to update some ref at the destination
with &lt;src&gt; with remote.&lt;repository&gt;.push configuration variable..."
impossible to understand.

To make the section easier to navigate, create a list of every possible
refspec form, with examples for each form as well as 2 forms which were
previously missing (patterns and negative refspecs).

Made a few changes to use more familiar language, but ultimately
refspecs are a pretty advanced feature so I've mostly left the
terminology alone.

Signed-off-by: Julia Evans &lt;julia@jvns.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: git-push: create PUSH RULES section</title>
<updated>2025-09-24T19:29:34Z</updated>
<author>
<name>Julia Evans</name>
<email>julia@jvns.ca</email>
</author>
<published>2025-09-23T18:10:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc1cc31e2a46e33941840bbb2026fff2d0532b2b'/>
<id>urn:sha1:cc1cc31e2a46e33941840bbb2026fff2d0532b2b</id>
<content type='text'>
Right now the rules for when a `git push` is allowed are buried at the
bottom of the description of `&lt;refspec&gt;`. Put them in their own section
so that we can reference them from `--force` and give some context for
why they exist.

Having the "PUSH RULES" section also lets us be a little bit more
specific with the rule in `--force`: we can just focus on the rule
for pushing for a branch (which is likely the one that's most relevant)
and leave the details about what happens when you push to a tag or a ref
that isn't a branch to the later section.

Signed-off-by: Julia Evans &lt;julia@jvns.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: check for absence of the form --[no-]parameter</title>
<updated>2025-08-11T21:16:04Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2025-08-11T20:53:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=03a353bb9759a1c775ba70f1e9ee865fc38291c2'/>
<id>urn:sha1:03a353bb9759a1c775ba70f1e9ee865fc38291c2</id>
<content type='text'>
For better searchability, this commit adds a check to ensure that parameters
expressed in the form of `--[no-]parameter` are not used in the
documentation.  In the place of such parameters, the documentation should
list two separate parameters: `--parameter` and `--no-parameter`.

Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
