1

How can I deploy to an existing Heroku app? I have made changes to my app locally and I now was to update my Heroku app with these changes.

To deploy the app for the first time I followed the commands provided by Heroku:

heroku login

cd my-project/
git init
heroku git:remote -a test-090909

git add .
git commit -am "make it better"
git push heroku master

But now I want to update my app with the changes I have made locally. So I ran the following command in my app to create the new build files:

npm run build

Then I tried the following commands to push the updated files to Heroku:

$ heroku login

$ heroku git:clone -a test-090909
$ cd test-090909

$ git add .
$ git commit -am "make it better"
$ git push heroku master

But the git:clone command gives me the following error:

fatal: destination path 'test-090909' already exists and is not an empty directory.
Reece
  • 2,581
  • 10
  • 42
  • 90
  • have you already checked [this out](https://stackoverflow.com/questions/50361138/destination-path-already-exists-and-is-not-an-empty-directory)? – Daemon Painter Apr 30 '20 at 15:56
  • @DaemonPainter thats helped me understand why this error is happening but it doesn't actually help me fix it – Reece Apr 30 '20 at 16:07
  • You are cloning into a directory that is not empty. You must clone into an empty directory – Daemon Painter Apr 30 '20 at 18:54

1 Answers1

0

first, make sure your local repository has the latest changes with the following command, git add -A then, git commit -m "latest commit" then push to heroku with git push heroku master

HTH

Wilson
  • 36
  • 1