help: move "git push --remote" explanation to main paragraph, some clarification

We might add --all-remotes at some point, but "jj git push" doesn't support
bulk push right now.

https://github.com/jj-vcs/jj/discussions/4901#discussioncomment-11607150
This commit is contained in:
Yuya Nishihara 2024-12-20 19:21:10 +09:00
parent dddeb8b526
commit 1b4e210524
2 changed files with 7 additions and 3 deletions

View file

@ -62,6 +62,10 @@ use crate::ui::Ui;
/// bookmarks. Use `--all` to push all bookmarks. Use `--change` to generate
/// bookmark names based on the change IDs of specific commits.
///
/// Unlike in Git, the remote to push to is not derived from the tracked remote
/// bookmarks. Use `--remote` to select the remote Git repository by name. There
/// is no option to push to multiple remotes.
///
/// Before the command actually moves, creates, or deletes a remote bookmark, it
/// makes several [safety checks]. If there is a problem, you may need to run
/// `jj git fetch --remote <remote name>` and/or resolve some [bookmark
@ -81,8 +85,6 @@ pub struct GitPushArgs {
///
/// This defaults to the `git.push` setting. If that is not configured, and
/// if there are multiple remotes, the remote named "origin" will be used.
/// Unlike in Git, the default remote is not derived from the tracked remote
/// bookmarks.
#[arg(long, add = ArgValueCandidates::new(complete::git_remotes))]
remote: Option<String>,
/// Push only this bookmark, or bookmarks matching a pattern (can be

View file

@ -1154,6 +1154,8 @@ Push to a Git remote
By default, pushes tracking bookmarks pointing to `remote_bookmarks(remote=<remote>)..@`. Use `--bookmark` to push specific bookmarks. Use `--all` to push all bookmarks. Use `--change` to generate bookmark names based on the change IDs of specific commits.
Unlike in Git, the remote to push to is not derived from the tracked remote bookmarks. Use `--remote` to select the remote Git repository by name. There is no option to push to multiple remotes.
Before the command actually moves, creates, or deletes a remote bookmark, it makes several [safety checks]. If there is a problem, you may need to run `jj git fetch --remote <remote name>` and/or resolve some [bookmark conflicts].
[safety checks]: https://jj-vcs.github.io/jj/latest/bookmarks/#pushing-bookmarks-safety-checks
@ -1166,7 +1168,7 @@ Before the command actually moves, creates, or deletes a remote bookmark, it mak
* `--remote <REMOTE>` — The remote to push to (only named remotes are supported)
This defaults to the `git.push` setting. If that is not configured, and if there are multiple remotes, the remote named "origin" will be used. Unlike in Git, the default remote is not derived from the tracked remote bookmarks.
This defaults to the `git.push` setting. If that is not configured, and if there are multiple remotes, the remote named "origin" will be used.
* `-b`, `--bookmark <BOOKMARK>` — Push only this bookmark, or bookmarks matching a pattern (can be repeated)
By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets#string-patterns.