{"record":{"id":"286f21229c45264a","repo":"usebruno/bruno","slug":"remote-not-configured","errorCode":null,"errorMessage":"Remote not configured","messagePattern":"Remote not configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/bruno-electron/src/utils/git.js","lineNumber":537,"sourceCode":"      .tags(['-l', '--format=%(refname:short)||%(creatordate)||%(creator)'])\n      .then((tags) => {\n        const tagDetails = tags.all?.map((tag) => {\n          const [name, date, author] = tag.split('||');\n          return { name, date, author };\n        });\n        resolve(tagDetails);\n      })\n      .catch(reject);\n  });\n};\n\nconst canPush = async (gitRootPath) => {\n  const git = getSimpleGitInstanceForPath(gitRootPath);\n  const branch = await git.revparse(['--abbrev-ref', 'HEAD']);\n  const remote = await git.listRemote(['--get-url', 'origin']);\n\n  if (!remote) {\n    throw new Error('Remote not configured');\n  }\n\n  const remoteInfo = await git.lsRemote(['--refs', remote]);\n  const logs = await git.log({ maxCount: 1 });\n  const localHead = logs.latest.hash;\n  const remoteRefs = remoteInfo.split('\\n');\n  const remoteHeads = remoteRefs.reduce((acc, ref) => {\n    const [hash, refName] = ref.split('\\t');\n    acc[refName.replace('refs/heads/', '')] = hash;\n    return acc;\n  }, {});\n  const remoteHead = remoteHeads[branch];\n\n  if (localHead === remoteHead) {\n    return false;\n  }\n\n  return true;","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/utils/git.js#L519-L555","documentation":"Thrown by canPush when git listRemote(['--get-url', 'origin']) returns an empty string. canPush is the pre-flight check before offering a push; with no 'origin' remote configured, there is nothing to push to and the check aborts.","triggerScenarios":"Running canPush on a git repo that has no remote named 'origin' (e.g. a fresh local repo, a repo whose remote was removed, or a remote named something other than 'origin').","commonSituations":"New collection repo not yet linked to GitHub/GitLab; remote renamed from 'origin'; cloned with a different default remote name; repo created locally via Bruno's git integration without configuring a remote.","solutions":["Add a remote: git -C <gitRootPath> remote add origin <url>, or use Bruno's remote-configuration UI.","If the remote is intentionally non-'origin', update canPush to accept the configured remote name.","Catch this error in the UI and prompt the user to configure a remote before retrying the push."],"exampleFix":"// before\nconst remote = await git.listRemote(['--get-url', 'origin']);\nif (!remote) {\n  throw new Error('Remote not configured');\n}\n\n// after: surface remediation to the caller\ntry {\n  await canPush(gitRootPath);\n} catch (e) {\n  if (e.message === 'Remote not configured') {\n    return { canPush: false, reason: 'no-origin', fix: 'Add a remote named origin' };\n  }\n  throw e;\n}","handlingStrategy":"validation","validationCode":"const { remote } = await require('simple-git')(gitRootPath).removeRemote.bind(null); // pseudo\nconst remotes = await require('simple-git')(gitRootPath).getRemotes(true);\nif (!remotes.some(r => r.name === 'origin')) {\n  return { canPush: false, reason: 'no-origin' };\n}\nawait canPush(gitRootPath);","typeGuard":"async function hasOriginRemote(gitRootPath) {\n  const git = getSimpleGitInstanceForPath(gitRootPath);\n  const remotes = await git.getRemotes(true);\n  return remotes.some(r => r.name === 'origin');\n}","tryCatchPattern":"try {\n  return await canPush(gitRootPath);\n} catch (err) {\n  if (err.message === 'Remote not configured') {\n    return { canPush: false, reason: 'no-origin', fix: 'Add a remote named origin' };\n  }\n  throw err;\n}","preventionTips":["Add a remote named 'origin' before enabling push in the UI.","Surface the missing-remote case as a setup prompt, not an error dialog.","If you use a non-'origin' remote name, extend canPush to accept it."],"tags":["git","remote","validation"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}