Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git sync: unhide jj git sync #4914

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### New features

* Implement `jj git sync`.

* Templates now support the `==` and `!=` logical operators for `Boolean`,
`Integer`, and `String` types.

Expand Down
1 change: 0 additions & 1 deletion cli/src/commands/git/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ pub enum GitCommand {
Remote(RemoteCommand),
#[command(subcommand, hide = true)]
Submodule(GitSubmoduleCommand),
#[command(hide = true)]
Sync(GitSyncArgs),
}

Expand Down
31 changes: 31 additions & 0 deletions cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ This document contains the help content for the `jj` command-line program.
* [`jj git remote remove`↴](#jj-git-remote-remove)
* [`jj git remote rename`↴](#jj-git-remote-rename)
* [`jj git remote set-url`↴](#jj-git-remote-set-url)
* [`jj git sync`↴](#jj-git-sync)
* [`jj help`↴](#jj-help)
* [`jj init`↴](#jj-init)
* [`jj interdiff`↴](#jj-interdiff)
Expand Down Expand Up @@ -1050,6 +1051,7 @@ For a comparison with Git, including a table of commands, see https://martinvonz
* `init` — Create a new Git backed repo
* `push` — Push to a Git remote
* `remote` — Manage Git remotes
* `sync` — Sync the local `jj` repo to remote Git branch(es)



Expand Down Expand Up @@ -1264,6 +1266,35 @@ Set the URL of a Git remote



## `jj git sync`

Sync the local `jj` repo to remote Git branch(es).

The sync command will first fetch from the Git remote(s), then rebase all local changes onto the appropriate updated heads that were fetched.

Changes that are made empty by the rebase are dropped.

**Usage:** `jj git sync [OPTIONS]`

###### **Options:**

* `-b`, `--branch <BRANCH>` — Rebase the specified branches only.

Note that this affects only the rebase behaviour, as the fetch behaviour always fetches all branches.

By default, the specified name matches exactly. Use `glob:` prefix to expand `*` as a glob. The other wildcard characters aren't supported.

Default value: `glob:*`
* `--all-remotes` — Fetch from all remotes

By default, the fetch will only use remotes configured in the `git.fetch` section of the config.

When specified, --all-remotes causes the fetch to use all remotes known to the underlying git repo.

Default value: `false`



## `jj help`

Print this message or the help of the given subcommand(s)
Expand Down
Loading
Loading