{"record":{"id":"62016ce10c6f2fef","repo":"gitbutlerapp/gitbutler","slug":"unable-to-determine-the-forge-for-this-project-is","errorCode":null,"errorMessage":"Unable to determine the forge for this project. Is target branch associated with a supported forge?","messagePattern":"Unable to determine the forge for this project\\. Is target branch associated with a supported forge\\?","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/forge/review.rs","lineNumber":392,"sourceCode":"    .await\n}\n\n/// Make sure that the account that is about to be used in this repository's forge is correctly authenticated.\nasync fn ensure_forge_authentication(ctx: &mut Context) -> Result<(), anyhow::Error> {\n    let (storage, forge_repo_info, preferred_forge_user) = {\n        let remote_url = ctx\n            .project_meta()?\n            .remote_url_with_fallback(&*ctx.repo.get()?)?;\n        let forge_repo_info = but_forge::derive_forge_repo_info(&remote_url);\n        (\n            but_forge_storage::Controller::from_path(but_path::app_data_dir()?),\n            forge_repo_info,\n            ctx.legacy_project.preferred_forge_user.clone(),\n        )\n    };\n\n    let forge_repo_info = forge_repo_info.ok_or_else(|| {\n        anyhow::anyhow!(\n            \"Unable to determine the forge for this project. Is target branch associated with a supported forge?\"\n        )\n    })?;\n\n    let account_validity =\n        but_forge::check_forge_account_is_valid(preferred_forge_user, &forge_repo_info, &storage)\n            .await?;\n\n    let forge_display_name = match forge_repo_info.forge {\n        but_forge::ForgeName::Azure => {\n            anyhow::bail!(\"Azure is unsupported at the minute. Sorry 😞.\");\n        }\n        but_forge::ForgeName::GitHub => \"GitHub\",\n        but_forge::ForgeName::GitLab => \"GitLab\",\n        but_forge::ForgeName::Bitbucket => \"Bitbucket\",\n    };\n\n    match account_validity {","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/forge/review.rs#L374-L410","documentation":"Forge review creation derives the forge (GitHub/GitLab/Bitbucket/Azure) from the project's remote URL via but_forge::derive_forge_repo_info; this error fires when that returns None — the target branch's remote URL doesn't map to any supported forge. It is a pre-check before account validation and API calls, telling you the project/remote configuration, not the network, is the blocker.","triggerScenarios":"Target branch tracking a remote whose URL is a private/unrecognized host (self-hosted Gitea/Gogs/Phabricator), a malformed or empty remote URL (with fallback to the repo's remote also failing), or SSH URLs whose host parsing doesn't match a known forge domain.","commonSituations":"Enterprise mirrors on internal domains; repos cloned from sourceforge-like hosts; remote renamed/broken so remote_url_with_fallback yields something unusable; forks configured with a git:// URL.","solutions":["Check `git remote -v` — the target branch's remote must point at a github.com/gitlab.com/bitbucket.org (or Azure DevOps) URL.","Re-add a proper remote URL if it's missing/odd: `git remote set-url origin git@github.com:owner/repo.git`.","Ensure the target branch actually tracks that remote (upstream is set) so the correct URL is picked.","If your forge is self-hosted and unsupported, review creation can't proceed — use the forge's own tooling."],"exampleFix":"# before\n$ git remote -v\norigin  https://gitea.internal/acme/repo.git (fetch)\n$ but forge review create\nError: Unable to determine the forge for this project. Is target branch associated with a supported forge?\n\n# after: point at a supported forge\n$ git remote set-url origin git@github.com:acme/repo.git\n$ but forge review create","handlingStrategy":"validation","validationCode":"// Check forge support before starting review creation\nlet url = ctx.project_meta()?.remote_url_with_fallback(&*ctx.repo.get()?)?;\nif but_forge::derive_forge_repo_info(&url).is_none() {\n    eprintln!(\"remote '{url}' is not a supported forge (GitHub/GitLab/Bitbucket/Azure)\");\n    return Ok(());\n}","typeGuard":"fn supported_forge(url: &str) -> Option<but_forge::ForgeRepoInfo> {\n    but_forge::derive_forge_repo_info(&BString::from(url))\n}","tryCatchPattern":"match create_review(ctx).await {\n    Err(e) if e.to_string().contains(\"Unable to determine the forge\") => {\n        // configuration problem: fix remote URL, do not retry blindly\n        Err(anyhow!(\"set the target branch upstream to a GitHub/GitLab/Bitbucket remote first\"))\n    }\n    other => other,\n}","preventionTips":["Ensure the target branch's upstream points at a supported forge remote before review flows.","Use canonical HTTPS/SSH URLs for github.com/gitlab.com/bitbucket.org.","Re-verify with `git remote -v` after cloning from mirrors."],"tags":["forge","remote-url","github","gitlab","review"],"backgroundTag":"unsupported-forge-remote","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}