SwarmOps
ReferenceCommandsswarmops remote add

Page kind: Reference

swarmops remote add#

Describes stable at 524167ec, ; latest release v0.11.0what changedLast changed View as Markdown

Record a git remote in the store.

The name is 1 to 63 lowercase letters, digits, dots, underscores and dashes, starting with a letter or a digit, not ending in a dot, and not status. Without --branch the remote is asked for its default branch (a network call); an empty remote gives main, with a warning. No credential is stored: --token-env records a variable's name. A URL holding a password is refused, and so is an http or https URL with a user part, whatever the user is: a token there cannot be told from a name. An ssh URL keeps its user. It needs no identity.

Metadata
Group
remotes
Since
0.2.0
Mutates
yes
Identity required
no
MCP tool
none
Envelope op
remote_add
Exit codes
0
Errors
none

Syntax#

Syntax
swarmops remote add [OPTIONS] <NAME> <URL>

Required arguments#

Syntax: <NAME>.

The remote's name.

Syntax: <URL>.

The remote's URL: an https or ssh URL, or the scp form user@host:path.

Optional arguments#

The command also takes the global options.

Syntax: --branch <BRANCH>.

The remote branch main follows (default: the remote's default branch).

Syntax: --token-env <VAR>.

The environment variable that holds a token for the remote, by its name.

Syntax: --lossy <CLASS>....

A class of content the import of the remote's commits may drop or normalize. Values: gitlinks: A submodule's entry: dropped; paths: A name that is no path component: not UTF-8, . or .., empty, or holding a /: dropped; modes: A mode git does not write, such as 100664: normalized; tree_order: A tree out of git's order, or naming an entry twice: put in order; empty_trees: An entry naming an empty tree: dropped; nonstandard: A commit whose bytes the changeset cannot keep: kept as its fields hold it; all: Every class.

Examples#

No recorded example yet.

Return information#

result is a RemoteInfo (swarmops schema RemoteInfo prints its JSON Schema).

FieldTypeRequiredDescription
branchstringyesThe remote branch main follows.
lossyarray of LossyClassyesThe classes of content the import of this remote's commits may drop or normalize.
namestringyesThe remote's name.
token_envstring or nullnoThe environment variable that holds a token for the remote, by its name; omitted when the remote names none.
urlstringyesThe remote's URL, as it was given.
warningsarray of string or nullnoWhat adding the remote has to say that did not stop it, such as default_branch_unknown (the remote named no default branch, so branch is main). Omitted when there is nothing.

Envelope op: remote_add.

Exit codes:

  • 0: Success.

Errors#

No golden step shows this command failing yet.

Any command that opens a store may also fail with a store error, such as E_NOT_A_REPO, E_IO or E_STORE_CORRUPT; a command line the grammar refuses is E_INVALID_ARG (exit 2).

See also#

On this page