Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

CLI app:Create fails to handle removal of existing 'heroku' git remote #2032

Open
hillct opened this issue Nov 6, 2016 · 2 comments
Open

Comments

@hillct
Copy link

hillct commented Nov 6, 2016

In the edge case of an app being deployed (successfully) via CLI, then deleted via the web dashboard, then deployed again via the CLI using the command:

heroku cerate

The process appears to complete, reporting no errors, however the 'heroku' remote has not been updated even egardless of there being no error presented. Issuing 'git push heroku master' Will fail at this point. A review of:

git remotes -v

shows that the 'heroku' remote has not been updated to reflect the new repository for the new app created above. Instead, it will reflect the repository of the previously created app (deleted via the web dashboard).

The workaround here once he underlying bud is identified - a manual remove and re-add of he 'heroku' remote via the commands:

git remote remove heroku
git remote add heroku

Once this is step is performed manually, the user can continue as normal to:

git push heroku master

with a successful result.

These tests were performed using the 'node-js-getting-started' app demo however, the same results can b generated using any properly functioning app/repo for any runtime.

The resolution should be to add a check for an existing remote having the name 'heroku' and removing it if it exists, in the sequence of git commands issued locally by the CLI as part of the 'heroku create' processing flow.

@jdx
Copy link
Contributor

jdx commented Nov 7, 2016

We only add the git remote if there isn't already one there. We can't remove the existing one since there might be a reason the user has it there, it could be a staging server or something else labeled heroku.

@Carringguns
Copy link

I'm pretty lost. When I get it it moves well. Heh

@simonneutert
Copy link

check your current git setting of a project: cd to/your/project

then (or open it in an editor)
cat .git/config

This file cannot know when you delete a repo on github ;)
So this is the place to edit, when you change your heroku project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants