Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push to heroku fails when repository already exists #1

Closed
OleMussmann opened this issue May 16, 2018 · 5 comments
Closed

Push to heroku fails when repository already exists #1

OleMussmann opened this issue May 16, 2018 · 5 comments

Comments

@OleMussmann
Copy link
Contributor

Push to heroku fails when repository already exists. First push is fine, though. A solution could be to remove the existing repo first, or to merge?

set git remote heroku to https://git.heroku.com/XYZ.git
To https://git.heroku.com/XYZ.git
 ! [rejected]        HEAD -> master (fetch first)
error: failed to push some refs to 'https://git.heroku.com/XYZ.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
 [!] Failed to git push to heroku
@godrei
Copy link

godrei commented May 17, 2018

Hi @OleMussmann ,
thanks for the issue report! We will have a look ASAP.

@OleMussmann
Copy link
Contributor Author

Probably you would need to change
git push heroku HEAD:master
to
git push heroku HEAD:master --force

I don't know how to test it locally, since I can't edit it in the bitrise repo.

@OleMussmann
Copy link
Contributor Author

Fixed in pull request #2.

@viktorbenei
Copy link
Contributor

viktorbenei commented May 26, 2018

Hi @OleMussmann ,

Just left some comment at #2

In general I'm OK with an opt-in force option, definitely don't do it by default.

Push to heroku fails when repository already exists.

The issue is related to something else, this step definitely works if the repo already exists. We use it in production to publish various bitrise.io services ;)

The error simply states that you tried to push from a branch which is behind or not consistent with the one on heroku. This might happen if you e.g. try to push your e.g. feature/a branch which might conflict with a previous push from e.g. feature/b. But if you push the same branch every time it definitely works - e.g. we usually use this step only in case of a push to master or develop branch.

@trapacska
Copy link
Contributor

Thanks @OleMussmann and also for the PR.

The new input is now released in the new version fo the step!

@bitrise-steplib bitrise-steplib locked and limited conversation to collaborators Sep 24, 2021
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