Fatal: Remote Hero Already Exists

I run the following commands and get a fatal: remote heroku already exists. error fatal: remote heroku already exists. .

I donโ€™t know whatโ€™s wrong here, he used to work without errors.

 git init git add . git commit -m 'Initial commit' git remote add heroku git@heroku.com :myapp.git 
+6
source share
6 answers

Open .git / config, you will find

 [remote "heroku"] url = git@heroku.com :xxx.git fetch = +refs/heads/*:refs/remotes/heroku/* 

Change xxx to the name of the application you want to click. Then

 git push heroku master 

This works for me. You can try.

+13
source

You should only run "git remote add" once. Perhaps you are looking for "git push"?

0
source

Are you trying to remove the add hero to the same directory as before? If so, try to do it in another, it should work.

0
source

You probably want:

 git add . git commit -m 'Information about what is in this commit' git push heroku master 

Note. I prefer git commit with the -m option on the command line, as this gives me another chance to review the material before committing.

0
source

You viewed the file . git / config ? You may have already created a remote for Heroku. And faffaffaff is correct in that you install it only once and that you need to use git push to move something to the remote repository, not git remote add .

0
source

You are trying to add a remote git that already exists. If you run the git remote -v command in the same folder as the previous commands, you will see a list of all the remote repositories that the local repository knows about. You should see two entries called heroku (one for push, one for fetch)

 git remote -v 

If you used the heroku create command in the same folder that added the remote git repository as alias heroku. As already mentioned, you do not need to add it again.

 # create your project git init git add . git commit -m "useful commit message" # run heroku create only once (unless you want additional environments - test, stageing) heroku create # deploy to heroku git push heroku master 

Keep expanding your code and adding / contributing it to your local git repository. When you are ready to deploy, then click on the hero.

 # work on your code git add . git commit -m "useful commit message" git push heroku master 
0
source

Source: https://habr.com/ru/post/948323/


All Articles