jdx/mise · error
has no branch ` `; it has: . Connect with `--branch `, or…
Error message
{url} has no branch `{branch}`; it has: {}{suffix}. Connect with `--branch <name>`, or push `{branch}` there first. What it means
Before connecting, mise checks the remote for the requested branch's head. If the remote does not publish that branch, the error lists the branches it does have (truncated with '(and N more)') and tells the user to pick one with `--branch` or push the branch upstream.
Solutions
- Push the branch to the remote: `git push origin <branch>`
- Connect with an existing branch: `mise dot origin set <url> --branch <listed-name>`
- Verify the URL points at the intended repository
Example fix
// before mise dot origin set git@github.com:user/repo.git --branch maain // after git push origin main mise dot origin set git@github.com:user/repo.git --branch main
Defensive patterns
Strategy: validation
Validate before calling
git ls-remote --heads <url> | grep -q "refs/heads/$BRANCH$" \
|| { echo "branch $BRANCH not on remote; push it or pick another"; exit 1; } Try / catch
match result {
Err(e) if e.to_string().contains("has no branch") => {
eprintln!("push the branch or connect with one of the listed branches");
}
_ => {}
} Prevention
- Run `git push -u origin <branch>` before connecting a new branch
- Check branch names with `git ls-remote --heads <url>`
- Confirm the remote URL points at the intended repository
When it happens
Trigger: set_inner -> refuse_missing_branch: the fetched remote heads for `{url}` do not include the target `branch` (typo, branch only exists locally, or the remote is the wrong repo).
Common situations: Typo in the branch name; the branch was never pushed (`git push -u origin branch` not run); pointing at a fork/remote that lacks the branch; shal-listed remote hiding the branch.
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
- could not fetch setup repository using local Git…
- git clone failed with
- git command failed with
- Git remote helpers are not supported for remote onboarding
- network Git calls do not accept a work tree, alternate…
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/ff54729e49270b25.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/history/sync/origin.rs:280
// a listing that fails must not read as an empty repository: that is the
// path this check exists to prevent
let refs = remote.ls_remote()?;
let heads: Vec<&str> = refs
.iter()
.filter_map(|(_, name)| name.strip_prefix("refs/heads/"))
.collect();
if heads.is_empty() || heads.contains(&branch) {
return Ok(());
}
let mut listed: Vec<&str> = heads.iter().copied().take(10).collect();
listed.sort_unstable();
let more = heads.len().saturating_sub(listed.len());
let suffix = if more > 0 {
format!(" (and {more} more)")
} else {
String::new()
};
bail!(
"{url} has no branch `{branch}`; it has: {}{suffix}. Connect with `--branch <name>`, or push `{branch}` there first.",
listed.join(", ")
);
}
pub(crate) fn report(outcome: &run::SyncOutcome) {
match &outcome.published {
Some(commit) => info!(
"history: published {}",
crate::cli::dotfiles::history::short(commit)
),
None => info!("history: nothing new to publish"),
}
if outcome.pending > 0 {
info!(
"history: {} incoming change(s) pending; `mise dot pull` applies them",
outcome.pending
);View on GitHub (pinned to 533346cc37)