gitbutlerapp/gitbutler · warning

No push remotes found

Error message

No push remotes found

What it means

is_used_by_default_remote detects whether the project's default push remote is a Gerrit server by probing the magic `refs/meta/config` refspec. If the repository has no default push remote configured, remote_default_name(Direction::Push) returns None and this error is thrown. It is an inherent part of the gerrit detection check rather than an unexpected failure.

Solutions

  1. Add a push remote: `git remote add origin <url>` and set `git push --set-upstream origin <branch>` once.
  2. If a remote exists, ensure it has a push URL: `git remote set-url --push origin <url>`.
  3. Verify with `git remote -v` that a push entry is listed before re-running the check.
  4. If Gerrit detection is irrelevant for this repo, skip calling this check for remote-less repositories.

Example fix

// before
let is_gerrit = gerrit::is_used_by_default_remote(&repo)?;
// after
let is_gerrit = match repo.remote_default_name(git2::Direction::Push) {
    Some(_) => gerrit::is_used_by_default_remote(&repo).unwrap_or(false),
    None => false,
};
Defensive patterns

Strategy: fallback

Validate before calling

let has_push_remote = repo
    .remotes()?
    .iter()
    .flatten()
    .any(|name| {
        repo.find_remote(name)
            .ok()
            .and_then(|r| r.pushurl().map(|s| !s.is_empty()).or(Some(true)))
            .unwrap_or(false)
    });

Try / catch

let is_gerrit = match gerrit::is_used_by_default_remote(&repo) {
    Ok(v) => v,
    Err(e) if e.to_string().contains("No push remotes") => false,
    Err(e) => return Err(e),
};

Prevention

When it happens

Trigger: Calling is_used_by_default_remote on a repo with no `origin`-style remote, or where the remote exists only with a fetch (not push) URL configured.

Common situations: Freshly cloned-less local repos, repos set up for fetch-only mirrors, repos where the user only configured `remote.<name>.fetchurl`, or projects cloned without any remote.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18). Data as JSON: /api/errors/cd8bc719008a538b. Report an issue: GitHub.

Appendix: source

Thrown at crates/gitbutler-project/src/gerrit.rs:10

/// Check if the default remote of the repository is using Gerrit.
pub fn is_used_by_default_remote(repo: &gix::Repository) -> anyhow::Result<bool> {
    use gix::{bstr::ByteSlice, remote::Direction};

    // Magic refspec that we use to determine if the remote is a Gerrit remote
    let gerrit_notes_ref = "refs/meta/config";

    let remote_name = repo
        .remote_default_name(Direction::Push)
        .ok_or_else(|| anyhow::anyhow!("No push remotes found"))?;

    let mut remote = repo.find_remote(remote_name.as_bstr())?;
    // Need to set fetch specs as ref-map requests always use fetch specs (it's not used when pushing)
    remote.replace_refspecs(vec![gerrit_notes_ref], Direction::Fetch)?;

    let (map, _) = remote
        .with_fetch_tags(gix::remote::fetch::Tags::None)
        .connect(Direction::Push)?
        .ref_map(gix::progress::Discard, Default::default())?;

    Ok(!map.remote_refs.is_empty())
}

View on GitHub (pinned to 58e5313667)