You may run into this error when performing one of these actions in Gearset:
Committing changes to a Main branch using Compare and deploy tool
Promoting changes between environments in your Gearset Pipeline
Validating a pull request in your Gearset Pipeline, where a pull request (PR) reports this error in the
Metadata validationtabResolving merge conflicts on a PR in Gearset Pipeline
Committing changes to your branch that are built with Gearset Agent (similarly to how a Compare and deploy would be used)
Generic error messaged displayed in Gearset
Currently, Gearset surfaces a more generic error in our app, which reads as follows:
There has been a problem deploying your changes. The error message returned was:
Push failed: couldn't push branch, likely because the repo has changed - try refreshing the comparison
This is how we report it for deployment attempts via Compare and deploy:
And in Gearset Pipeline on a PR validation it would show as on below image:
Git related error messages our logs surfaced for this issue
In this article, we're providing a list of different error messages, typically Git related ones, that have been surfaced in Gearset logs as underlying caused of this issue.
Error: "GH013: Repository rule violations found for refs/heads/main"
This is a common error if you're trying to make a commit (deployment) from a source environment (e.g. a Salesforce org) to the Main/Master branch of your organisation's Git repository. In our logs, this reports as:
error: GH013: Repository rule violations found for refs/heads/main.
remote: - Changes must be made through a pull request
Root cause
The Main/Master branch of the repository has a rule that requires changes to go through a pull request, so every direct push to Main/Master gets refused.
These rules are created and managed by your repository or organisation admins in GitHub - this is done through rulesets, branch protection or push protection. Gearset doesn’t create or control the rules, nor can we override them.
If you're a GitHub user, check documentation on managing a branch protection rule and managing rulesets for a repository.
Until the commit meets the rule, or the rule is changed, GitHub will keep rejecting the push (commit), no matter how many times you re-try the deployment or refresh the comparison in our app.
Note: This is specifically a GitHub error code, so o it only appears for GitHub repositories (GitHub.com and GitHub Enterprise). Azure DevOps, GitLab and Bitbucket can reject pushes (commits) for the same reason but use their own formatting for error messages.
Feedback
If you have run into this error, and the above suggestions to resolve don't quite apply to your use case or scenario - we encourage you to get in touch with our Customer Support via in-app chat.
We'll be happy to dig into the logs to help you understand the underlying cause of the error show in Gearset app.


