← Back to Docs

How to fix “Could not compare ….. to master branch” error

Overview

If you have ever seen this error when first initializing a project in Emtrey, it is likely that you have not run it on your base branch first.

Emtrey requires all projects to be managed by version control, git. No matter which branching strategy your team follows (eg. gitflow), utilizing different branches and commits is key to Emtrey tracking changes. By default, Emtrey compares all branches to the base branch.

The Solution

Since Emtrey compares changes across branches, you must run Emtrey on your base branch before running it on any other branches (eg. master, main, etc). This gives Emtrey a concept of what is likely deployed to production and a baseline for comparing other future changes/branches.

To resolve this issue, complete the following steps:

  1. Navigate to the root directory for your project.
  2. Switch to your base branch (eg. master, main, etc.)
  3. Start your application locally.
  4. Run the Emtrey CLI tool:
    npx emtrey --port=<PORT>
  5. After completing the base branch run-through, you can switch to another branch.

Heads Up! All projects must have a run-through on the base branch (eg. master).