Duplicate Build Version Detected
Last updated December 11, 2023
Deploying the same version of your application multiple times can indicate that you’re 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"
Run git status
again to verify that there’s nothing left to commit. Deploy to Heroku.
Diagnosing Deploys from a Different Branch
If you see 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 (main
), run this command.
$ git push heroku main
Following changes in the industry, Heroku updated the 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 means that you’re telling Git to push the contents of your main
branch to the main
branch of the Heroku remote.
$ git push heroku main:main
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 you want to push that to main
on the Heroku remote, use this command.
$ git push heroku my_staging_branch:main