Skip to content

Commit

Permalink
help: move "git push --remote" explanation to main paragraph, some cl…
Browse files Browse the repository at this point in the history
…arification

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

#4901 (comment)
  • Loading branch information
yuja committed Dec 21, 2024
1 parent dddeb8b commit 1b4e210
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cli/src/commands/git/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 1b4e210

Please sign in to comment.