“git push heroku master”的问题
我再次开始使用 Heroku,但在尝试将其上传到我的服务器时遇到了一些问题。我已经采取了正确安装 Heroku gem 的步骤,并将 Sinatra 和 Ruby 安装到我的 Mac 上。由于我已经离开它有一段时间了,所以我执行了以下步骤:
gem remote rm heroku
gem remote add heroku [email protected]:pxlc.git
cd Desktop/myapp
git init
git add .
git commit -m 'Initial commit'
git push heroku master
之后我收到这个奇怪的错误,告诉我执行“git pull”。我不应该能够输入我的 .ssh 密钥和 Heroku 凭据吗?
I began taking up Heroku again, but have had some problems trying to get it to where I could upload an app to my server. I have taken the steps already to have the Heroku gem properly installed and both Sinatra and Ruby installed onto my Mac. Since I have been away from it for a while, I did these steps:
gem remote rm heroku
gem remote add heroku [email protected]:pxlc.git
cd Desktop/myapp
git init
git add .
git commit -m 'Initial commit'
git push heroku master
After that I get this strange error telling me to do a "git pull". Shouldn't I have been able to put in my .ssh key and Heroku credentials?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
告诉您进行拉取的错误告诉您无法在当前状态下推送,因为您会覆盖已推送到 git 远程的其他一些工作。您首先必须将远程更改合并到本地代码中,然后再推送。看起来您正在创建全新的存储库并尝试将其推送到已经存在的地方。
编辑:要做它告诉你的事情,只需
git pull heroku master
。它将获取所有远程更改并将它们合并到您的分支中。这可能会因合并冲突而失败,然后您必须解决这些冲突。如果成功了,那就没什么可做的了。如果你确实想清除那里的任何东西——就像永远消失一样——你可以 git push -f heroku master 来强制推送。
An error telling you to do a pull is telling you that you can't push in your current state because you'd overwrite some other work that's been pushed to the git remote. You first have to pull to merge the remote changes into your local code, then push. It looks like you're creating brand new repo and trying to push it somewhere where something already exists.
Edit: To do what it's telling you, just
git pull heroku master
. It will fetch all the remote changes and merge them into your branch for you. This could fail with merge conflicts, which you'd then have to resolve. If it's successful, there's nothing else to do.If you really do want to wipe out anything that's there--as in lost forever wipe out--you can
git push -f heroku master
to force the push.heroku 步骤也让我困惑
对于一个原始的新项目
初始化,提交,
然后
git Remote add heroku=>heroku命令给出的git地址
然后推动
我经常被卡住
所以
我喜欢自己将其直接添加到 .git/config 文件中)
如果 heroku 位于 -1 (没有历史记录)
将您的 git 存储库(以及您的历史记录)推送到 Heroku 端应该没有问题
the heroku steps confuse me too
for a pristine new project
init,commit,
THEN
git remote add heroku=>the git address given by heroku command
THEN push
i get stuck often
so
i like to add it directly to .git/config file myself)
if heroku is at -1 (no history)
there should be no issue pushing your git repo (along with yr history) to heroku side