Skip to content

Commit

Permalink
cli: git: document about default fetch/push --remote
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Oct 30, 2024
1 parent fa625d9 commit 377c3b5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli/src/commands/git/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ pub struct GitFetchArgs {
branch: Vec<StringPattern>,
/// The remote to fetch from (only named remotes are supported, can be
/// repeated)
///
/// This defaults to the `git.fetch` setting. If that is not configured, and
/// if there are multiple remotes, the remote named "origin" will be used.
#[arg(long = "remote", value_name = "REMOTE")]
remotes: Vec<String>,
/// Fetch from all remotes
Expand Down
5 changes: 5 additions & 0 deletions cli/src/commands/git/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ use crate::ui::Ui;
#[command(group(ArgGroup::new("what").args(&["all", "deleted", "tracked"]).conflicts_with("specific")))]
pub struct GitPushArgs {
/// 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.
#[arg(long)]
remote: Option<String>,
/// Push only this bookmark, or bookmarks matching a pattern (can be
Expand Down
5 changes: 5 additions & 0 deletions cli/tests/[email protected]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: cli/tests/test_generate_md_cli_help.rs
description: "AUTO-GENERATED FILE, DO NOT EDIT. This cli reference is generated by a test as an `insta` snapshot. MkDocs includes this snapshot from docs/cli-reference.md."
snapshot_kind: text
---
<!-- BEGIN MARKDOWN-->

Expand Down Expand Up @@ -1056,6 +1057,8 @@ If a working-copy commit gets abandoned, it will be given a new, empty commit. T
Default value: `glob:*`
* `--remote <REMOTE>` — The remote to fetch from (only named remotes are supported, can be repeated)
This defaults to the `git.fetch` setting. If that is not configured, and if there are multiple remotes, the remote named "origin" will be used.
* `--all-remotes` — Fetch from all remotes
Expand Down Expand Up @@ -1116,6 +1119,8 @@ Before the command actually moves, creates, or deletes a remote bookmark, it mak
###### **Options:**
* `--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.
* `-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://martinvonz.github.io/jj/latest/revsets#string-patterns.
Expand Down

0 comments on commit 377c3b5

Please sign in to comment.