LinuxCommandLibrary

jj-git-remote

Manage Git remotes

TLDR

List all Git remotes

$ jj git remote list
copy

Add a Git remote
$ jj git remote add [remote] [url]
copy

Change the URL of a Git remote
$ jj git remote set-url [remote] [url]
copy

Remove a Git remote
$ jj git remote remove [remote]
copy

Rename a Git remote
$ jj git remote rename [old_name] [new_name]
copy

SYNOPSIS

jj git remote [-h|--help] [--repository <REPO_PATH>] <list|add NAME URL|remove NAME>

PARAMETERS

-h, --help
    Print help information

--repository <REPO_PATH>, -R <REPO_PATH>
    Repository to operate on; defaults to current

list
    List all configured remotes (default subcommand)

add <NAME> <URL>
    Add a new remote with given name and URL

remove <NAME>
    Remove the remote with given name

DESCRIPTION

The jj git remote command is part of Jujutsu (jj), a Git-compatible version control system designed for better usability and performance. It enables management of remotes in a format compatible with Git, allowing seamless interaction with Git hosting services like GitHub or GitLab.

Use it to add, list, remove, or configure remotes for operations like jj git push and jj git fetch. Remotes store URLs for repositories, supporting both fetch (pulling changes) and push configurations. Jujutsu stores remote info in its own config but uses Git-compatible URLs and names.

This command bridges pure Jujutsu workflows with Git ecosystems, ensuring portability. It's essential for collaborative projects where contributors use different tools. Run without arguments to list remotes.

CAVEATS

Remotes must use Git-compatible URLs. Jujutsu does not support all Git remote options like mirrors or tags. Always verify with jj git fetch after changes.
Conflicts may arise if repo is concurrently modified.

EXAMPLES

jj git remote add origin https://github.com/user/repo.git
jj git remote list
jj git remote remove origin

CONFIGURATION

Remotes stored in repo.toml under [remote.<name>]. Edit manually or via command. Supports separate fetch/push URLs.

HISTORY

Introduced in Jujutsu v0.1.0 (2022) by Martin von Zweigbergk at Google. Evolved to support Git remote export/import in v0.14+ for better interoperability. Actively developed on GitHub (martinvonz/jj).

SEE ALSO

jj(1), git-remote(1), git(1)

Copied to clipboard