Duplicate Build Version Detected
Last updated March 21, 2022
Deploying the same version of your application multiple times can be an indication that you are pushing code to Heroku incorrectly. This article explains how these duplicate deploys with the same code version are possible, and how to diagnose and fix the issue.
Diagnosing Uncommitted Local Files
Verify that you committed all of your local changes:
$ git status On branch main nothing to commit, working tree clean
If you don’t see “nothing to commit”, you must check in your code changes. Run this command to add them all:
$ git add -A $ git commit -m "code"
git status again to verify there’s nothing left to commit. Deploy to Heroku.
Diagnosing Deploys From a Different Branch
If you’re seeing the duplicate deploy warning when you push your code, and all of your files are committed locally, check if you’re attempting to deploy from another branch. If you’re on a branch that’s different than the one you’re trying to deploy to on Heroku (
$ git push heroku main
Following changes in the industry, Heroku has updated our default git branch name to
main. If the project you’re deploying uses
master as its default branch name, use
git push heroku master.
This command is a shortcut for:
$ git push heroku main:main
It means you’re telling git to push the contents of your
main branch to the
main branch of the Heroku remote. If you’re on a different branch, you must specify it manually:
$ git push heroku <mybranchname>:main
For example, if you’re currently developing on a branch called
my_staging_branch and want to push that to
main on the Heroku remote, the command is:
$ git push heroku my_staging_branch:main