Last updated June 15, 2023
A Heroku app’s Git repository is intended for deployment purposes only. Cloning from this repository is not officially supported as a feature. Attempt it only as a last resort. Don’t use this repository as your app’s canonical origin repository. Instead, use your own Git server or a version control service such as GitHub.
If necessary, you can clone your app’s source from its Heroku Git repository with the heroku git:clone command.
$ heroku git:clone -a example-app
Replace example-app with the name of your app.
This command creates a copy of the Heroku-hosted repository that contains your app’s source and complete repository history. It also includes a heroku Git remote to simplify future pushes.
You can’t clone your app’s source from Heroku if you deploy your app with any method besides git push. Other deployment methods don’t update your app’s Heroku Git repo, causing heroku git:clone to return an empty repository. These other deployment methods include: