Page kind: Reference
swarmops fetch#
Fetch a git remote into the store's mirror, and its followed branch into the store.
Git 2.39 or later fetches the remote's branches and tags into the store's mirror; the followed branch's commits become changesets, with no ref moved: main never moves. Run again with nothing new on the remote, it imports nothing. It needs no identity.
- Group
remotes- Since
0.2.0- Mutates
- yes
- Identity required
- no
- MCP tool
fetch- Envelope op
fetch- Exit codes
- 0
- Errors
- none
Syntax#
swarmops fetch [OPTIONS] <REMOTE>Required arguments#
Syntax: <REMOTE>.
The remote, by its name.
Optional arguments#
The command also takes the global options.
Examples#
No recorded example yet.
No recorded example yet.
Return information#
result is a FetchResp (swarmops schema FetchResp prints its JSON Schema).
| Field | Type | Required | Description |
|---|---|---|---|
branch | string | yes | The followed branch. |
branches | array of BranchUpdate | yes | The remote branches that moved, appeared or went, at most 1,000. |
branches_truncated | boolean | yes | Whether more branches moved than branches lists. |
head | RemoteHead or null | no | The followed branch's head after the fetch; omitted when the remote has no such branch. |
imported | integer | yes | How many changesets the import of the followed branch added. |
old_head | RemoteHead or null | no | The followed branch's head as the last fetch saw it; omitted when none did. |
remote | string | yes | The remote, by its name. |
tags_fetched | integer | yes | How many tags the fetch brought into the mirror (they are never imported). |
warnings | array of string or null | no | What the fetch has to say that did not stop it. Omitted when there is nothing. |
Envelope op: fetch.
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).