Can't push to existing live heroku app on Cedar Stack

六月ゝ 毕业季﹏ 提交于 2019-12-13 07:12:27

问题


I successfully pushed a live app to heroku on cedar stack at livebytransit.com a few weeks ago, and I have successfully pushed code changes until recently. I have not been able to push code changes after creating a staging app from the same working directory...see afternoon-cloud-6227.herokuapp.com. My thought was to push changes first to afternoon-cloud, then if all looked good, push to the main site. As it stands right now, I can't push changes to either app.

Here is some code that shows some things I have tried. I think there are so many things wrong with this that my best bet is to probably create a new folder, clone the app from github, and redeploy to a new app on heroku and burn the two existing apps....but I have some users that would get blown away in the process so I would like to salvage what I have in my existing directory if possible.

TBones-MacBook-Pro:livebytransit PG$ git remote -v
afternoon-cloud-6227    git@heroku.com:afternoon-cloud-6227.herokuapp.git (fetch)
afternoon-cloud-6227    git@heroku.com:afternoon-cloud-6227.herokuapp.git (push)
heroku  git@heroku.com:livebytransit.herokuapp.git (fetch)
heroku  git@heroku.com:livebytransit.herokuapp.git (push)
orgin   git@github.com:tom-brown/LiveByTransit.git (fetch)
orgin   git@github.com:tom-brown/LiveByTransit.git (push)

TBones-MacBook-Pro:livebytransit PG$ git add .
TBones-MacBook-Pro:livebytransit PG$ git commit -am"lots of changes that have been pushed to github already via git push orgin master"
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   voting (modified content)
#
no changes added to commit (use "git add" and/or "git commit -a")

TBones-MacBook-Pro:livebytransit PG$ git push afternoon-cloud-6227

 !  Invalid path.
 !  Syntax is: git@heroku.com:<app>.git where <app> is your app's name.

fatal: The remote end hung up unexpectedly

TBones-MacBook-Pro:livebytransit PG$ git push orgin master
Everything up-to-date

TBones-MacBook-Pro:livebytransit PG$ git remote rm afternoon-cloud-6227
TBones-MacBook-Pro:livebytransit PG$ git remote add livebytransit git@heroku.com:livebytransit.herokuapp.git
TBones-MacBook-Pro:livebytransit PG$ git remote -v
heroku  git@heroku.com:livebytransit.herokuapp.git (fetch)
heroku  git@heroku.com:livebytransit.herokuapp.git (push)
livebytransit   git@heroku.com:livebytransit.herokuapp.git (fetch)
livebytransit   git@heroku.com:livebytransit.herokuapp.git (push)
orgin   git@github.com:tom-brown/LiveByTransit.git (fetch)
orgin   git@github.com:tom-brown/LiveByTransit.git (push)

TBones-MacBook-Pro:livebytransit PG$ git add .
TBones-MacBook-Pro:livebytransit PG$ git commit -a -m "lots of changes already commited to github via git push orgin master"
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   voting (modified content)
#
no changes added to commit (use "git add" and/or "git commit -a")

TBones-MacBook-Pro:livebytransit PG$ git push orgin master
Everything up-to-date

TBones-MacBook-Pro:livebytransit PG$ git push heroku master

 !  Invalid path.
 !  Syntax is: git@heroku.com:<app>.git where <app> is your app's name.

fatal: The remote end hung up unexpectedly

TBones-MacBook-Pro:livebytransit PG$ git push heroku livebytransit

 !  Invalid path.
 !  Syntax is: git@heroku.com:<app>.git where <app> is your app's name.

fatal: The remote end hung up unexpectedly

TBones-MacBook-Pro:livebytransit PG$ git push heroku git@heroku.com:livebytransit.herokuapp.git

 !  Invalid path.
 !  Syntax is: git@heroku.com:<app>.git where <app> is your app's name.

fatal: The remote end hung up unexpectedly

TBones-MacBook-Pro:livebytransit PG$ git push heroku:livebytransit.herokuapp.git
ssh: Could not resolve hostname heroku: nodename nor servname provided, or not known
fatal: The remote end hung up unexpectedly

One thing that is really puzzling me is why origin is misspelled. It makes me wonder if I somehow changed this by accident? Any thoughts or advice would be very much appreciated.


回答1:


It sounds to me like your heroku remote is borked in .git/config.

Given that your application is living at livebytransit.herokuapp.com, your heroku remote should be:

git@heroku.com:livebytransit.git

If you're looking to have topic branches of the same application running in two seperate Heroku applications I recommend you read this:

http://neilmiddleton.com/deploying-topic-branches-to-heroku/




回答2:


Neil's answer actually worked for me. I checked .git/config and found that somehow, there was an extra .git in there, as follows:

[remote "heroku"]
url = git@heroku.com:jon-demo-app.git.git
fetch = +refs/heads/*:refs/remotes/heroku/*

I changed jon-demo-app.git.git to jon-demo-app.git and was golden.



来源:https://stackoverflow.com/questions/8782079/cant-push-to-existing-live-heroku-app-on-cedar-stack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!