usebruno/bruno · warning · Error
Remote not configured
Error message
Remote not configured
What it means
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.
Source
Thrown at packages/bruno-electron/src/utils/git.js:537
.tags(['-l', '--format=%(refname:short)||%(creatordate)||%(creator)'])
.then((tags) => {
const tagDetails = tags.all?.map((tag) => {
const [name, date, author] = tag.split('||');
return { name, date, author };
});
resolve(tagDetails);
})
.catch(reject);
});
};
const canPush = async (gitRootPath) => {
const git = getSimpleGitInstanceForPath(gitRootPath);
const branch = await git.revparse(['--abbrev-ref', 'HEAD']);
const remote = await git.listRemote(['--get-url', 'origin']);
if (!remote) {
throw new Error('Remote not configured');
}
const remoteInfo = await git.lsRemote(['--refs', remote]);
const logs = await git.log({ maxCount: 1 });
const localHead = logs.latest.hash;
const remoteRefs = remoteInfo.split('\n');
const remoteHeads = remoteRefs.reduce((acc, ref) => {
const [hash, refName] = ref.split('\t');
acc[refName.replace('refs/heads/', '')] = hash;
return acc;
}, {});
const remoteHead = remoteHeads[branch];
if (localHead === remoteHead) {
return false;
}
return true;View on GitHub (pinned to 9bdd81c7bd)
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.
Example fix
// before
const remote = await git.listRemote(['--get-url', 'origin']);
if (!remote) {
throw new Error('Remote not configured');
}
// after: surface remediation to the caller
try {
await canPush(gitRootPath);
} catch (e) {
if (e.message === 'Remote not configured') {
return { canPush: false, reason: 'no-origin', fix: 'Add a remote named origin' };
}
throw e;
} Defensive patterns
Strategy: validation
Validate before calling
const { remote } = await require('simple-git')(gitRootPath).removeRemote.bind(null); // pseudo
const remotes = await require('simple-git')(gitRootPath).getRemotes(true);
if (!remotes.some(r => r.name === 'origin')) {
return { canPush: false, reason: 'no-origin' };
}
await canPush(gitRootPath); Type guard
async function hasOriginRemote(gitRootPath) {
const git = getSimpleGitInstanceForPath(gitRootPath);
const remotes = await git.getRemotes(true);
return remotes.some(r => r.name === 'origin');
} Try / catch
try {
return await canPush(gitRootPath);
} catch (err) {
if (err.message === 'Remote not configured') {
return { canPush: false, reason: 'no-origin', fix: 'Add a remote named origin' };
}
throw err;
} Prevention
- 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.
When it happens
Trigger: 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').
Common situations: 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.
Related errors
- Invalid Git URL
- Invalid strategy
- A non-empty Git remote URL is required
- Collection not found in workspace
- Workspace path not found
AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13).
Data as JSON: /api/errors/286f21229c45264a.
Report an issue: GitHub.