diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 5e03779ec0412071587461b711e7d130b49f7ac2..216a63edea9b7d7ab996b44e515a9754797ad2e3 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -703,6 +703,13 @@ export async function commitFiles({ return commit; } catch (err) /* istanbul ignore next */ { checkForPlatformFailure(err); + if (err.message.includes(`'refs/heads/renovate' exists`)) { + const error = new Error(CONFIG_VALIDATION); + error.configFile = 'None'; + error.validationError = 'An existing branch is blocking Renovate'; + error.validationMessage = `Renovate needs to create the branch "${branchName}" but is blocked from doing so because of an existing branch called "renovate". Please remove it so that Renovate can proceed.`; + throw error; + } if ( err.message.includes( 'refusing to allow a GitHub App to create or update workflow'