---
name: "public-inbox-fetch"
section: "1"
platform: "linux"
package: "public-inbox"
version: "1.9.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/public-inbox-fetch"
---

# public-inbox-fetch(1)

"git fetch" wrapper for v2 inbox mirrors

## NAME

public-inbox-fetch - "git fetch" wrapper for v2 inbox mirrors

## SYNOPSIS

public-inbox-fetch \[--exit-code\] -C INBOX\_DIR

## DESCRIPTION

public-inbox-fetch updates git storage of public-inbox mirrors. With v2 inboxes, it allows detection of new epochs and avoids unnecessary traffic on old epochs.

public-inbox-fetch does not use nor require any configuration files of its own.

It does not run [**public-inbox-index**(1)](/public-inbox-index/1.md), making it suitable for maintaining git-only backups.

For v2 inboxes, it will maintain `"$INBOX_DIR/manifest.js.gz"` file to speed up future invocations.  It always safe to remove manifest.js.gz, it is merely an optimization and will be restored on the next invocation.

To prevent fetches on any v2 epoch, use [**chmod**(1)](/chmod/1.md) to remove write permissions to the top-level of the epoch.  For example, to disable fetches on epoch 4:

```
        chmod a-w $INBOX_DIR/git/4.git
```

If you wish to re-enable fetches to the epoch:

```
        chmod u+w $INBOX_DIR/git/4.git
```

## OPTIONS

- \-q

  - \--quiet

  Quiets down progress messages, also passed to [**git-fetch**(1)](/git-fetch/1.md).

- \-T REMOTE

  - \--try-remote REMOTE

  Try a given remote name instead of `"origin"` or `"_grokmirror"`. May be specified more than once.

  Default: `"origin"`, `"_grokmirror"`

- \--exit-code

  Exit with `127` if no updates are done.  This can be used in shell scripts to avoid invoking [**public-inbox-index**(1)](/public-inbox-index/1.md) when there are no updates:

  ```
          public-inbox-fetch -q --exit-code && public-inbox-index
          test $? -eq 0 || exit $?
  ```

- \-v

  - \--verbose

  Increases verbosity, also passed to [**git-fetch**(1)](/git-fetch/1.md).

- \--torsocks=auto\|no\|yes

  - \--no-torsocks

  Whether to wrap [**git**(1)](/git/1.md) and [**curl**(1)](/curl/1.md) commands with [**torsocks**(1)](/torsocks/1.md).

  Default: `"auto"`

## EXIT CODES

- 127

  no updates when "--exit-code" is used above

public-inbox-fetch will also exit with curl "EXIT CODES" in [**curl**(1)](/curl/1.md) as documented in the [**curl**(1)](/curl/1.md) manpage (e.g. `7` when curl cannot reach a host).  Likewise, [**git-fetch**(1)](/git-fetch/1.md) failures are also propagated to the user.

## CONTACT

Feedback welcome via plain-text mail to \<mailto:meta@public-inbox.org\>

The mail archives are hosted at \<https://public-inbox.org/meta/\> and \<http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/\>

## COPYRIGHT

Copyright all contributors \<mailto:meta@public-inbox.org\>

License: AGPL-3.0+ \<https://www.gnu.org/licenses/agpl-3.0.txt\>

## SEE ALSO

[**public-inbox-index**(1)](/public-inbox-index/1.md), [**curl**(1)](/curl/1.md)
