Git pushes to wrong heroku app

git, heroku

Solution

Indeed, you should understand what is a remote repository.

You can for example type `git remote -v` and see the result to clearly see where you are pushing.

from there, `git remote rm heroku` allows you to remove the remote repository. And `git remote add heroku {address}` allows you to add a remote repository whose address you should specify.

The address of the corresponding remote is provided by heroku. Go on the app details on the heroku website and copy paste it from there. After that, the git push heroku master should push to the good repository.

When you copy pasted, the project, you also copy pasted the .git directory of the project so all the old settings of git for it. I think that a `git clone` would have been a better approach

Problem

This I'm sure is based solely on my lack of understanding of git, The problem is I don't know what I don't know. I have a successful app deployed to Heroku. It tracks work orders for my fire dept. In my normal work flow, I use `$ git push heroku master` from the app directory to deploy my changes. I needed to set this same app up for another fire dept. So I figured I'd make a copy of it on my local machine, set up a new heroku app, make the changes needed to make the new copy specific to the new fire dept. I'd run `git init` etc, then push it up to the new heroku app. Problem is, it pushes up to the old one. I figure this is because all the git settings were copied when I copied the app directory. How do I make it separate, so they act like 2 unique apps? Is there a certain feature/area of git that I should learn about to understand what's going on here?

Original source