Resolve Source Control merge conflicts

Learn how to resolve merge conflicts when using Source Control.

In some cases, while developing you may run into merge conflicts against the main or configured default branch. These may come up when another developer collaborating on the same app makes a change that overlaps with your branchโ€™s changes. Typically, your remote source control management provider (GitHub, GitLab, etc.) will make this clear from the pull request page and prevent merging.

At this time, conflicts must be resolved outside of the Retool platform. To do so, you can resolve conflicts via the Web UI of your source control management provider or locally via the source management tool of your choosing. If using the command line, for example, clone the Git repo locally, check out your branch, and rebase your branch to the latest dev. Once rebased and conflicts have been resolved, force push to the origin branch.

$ git clone [email protected]:myorganization/retool_source.git
$ git checkout main
$ git checkout my-feature-branch
$ git rebase main
... resolve conflicts
$ git push origin my-feature-branch --force

After the remote branch has been updated, you may want to preview your changes again in Retool before merging to ensure your conflict resolution was completed properly.

To do so, open your branch in Retool and use the "Reset branchโ€ option to then select the branch and pull the updated branch into Retool to preview.

After completing your visual and interactive review, you can proceed with merging the updated branch and pull request.

Soft resetting changes

Sometimes, merging doesn't work and the branch appears to be up-to-date with the remote main, even though regressions are still present. In order to resolve this issue, you can try soft resetting your branch to delete the regressions manually.

$ git reset --soft HEAD~<N> # Set N to the number of commits currently present on the branch

# Use your code editor or preferred method to un-stage files that contain regressions

# Use your code editor or preferred method to discard regression changes

$ git commit -m "<your-commit-message-here"
$ git push --force