为什么Heroku认为一切都是最新的? [英] Why does Heroku think everything is up-to-date when it isn't?

查看:98
本文介绍了为什么Heroku认为一切都是最新的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Heroku上我有一个生产应用程序,我知道有一个临时应用程序:

  $ heroku list 
= ==我的应用程序
testivate
testivate-staging

每个遥控器都有遥控器:

  $ git remote -v 
heroku git@heroku.com:testivate.git(fetch)
heroku git@heroku.com:testivate.git(推)
分期git@heroku.com:testivate-staging.git(获取)
分期git@heroku.com:testivate-staging.git(推送)

几天后,部署破坏了我的产品应用程序,所以我使用 heroku rollback ,最终创建了我现在正在使用的登台应用程序,并将我的代码推送到登台应用程序,推测是使用 git push staging master 。 (这是几天前,但我很确定这就是我所做的。)

现在所有工作都在我的分期应用上,所以我试图推动我的代码到我的制作应用程序。



然而,Heroku一直告诉我我的制作应用程序已经是最新的:

  $ git branch 
* master

$ git status
#分支master
没有提交工作目录干净)

$ git add。
$ git add -u
$ git commit -m试图提交
#在分支master
上没有提交(工作目录干净)

$ git push heroku master
所有最新的

$ git远程显示暂存
*远程暂存
提取网址:git@heroku.com:testivate -staging.git
推送网址:git@heroku.com:testivate-staging.git
HEAD分支:master
远程分支:
跟踪的主数
配置的本地参考'git push':
主人推送到主人(最新)

$ git远程显示heroku
*远程heroku
获取URL:git @ heroku。 com:testivate.git
推送网址:git@heroku.com:testivate.git
HEAD分支:master
远程分支:
跟踪的主数
配置的本地参考'git push':
主人推动主人(最新)

我知道然而,Heroku是错误的,因为我的观点有一些明显的改变,你可以在我的文章中看到ocal代码和登台服务器上,但不是在我的现场制作应用程序中。

例如,比较正确的back链接这里在我的登台应用程序中,但不是在这里在我的生产应用程序。



我如何让Heroku更新我的制作应用程序?



谢谢,

Steven。

解决方案

你确定你指的是正确的分支吗?以下是实际命令的语法:

  git push heroku<您希望推送的分支>:<分支开启您希望推送到的heroku服务器> 

所以如果您习惯于运行

  git push heroku master 

你签出并提交除master之外的其他分支,运行 git push heroku master 会推送您未更改的主分支分支。相反,运行

  git push heroku the_branch_i_changed:master 


On Heroku I have a production app and I know have a staging app:

$ heroku list
=== My Apps
testivate
testivate-staging

I have remotes for each:

$ git remote -v
heroku  git@heroku.com:testivate.git (fetch)
heroku  git@heroku.com:testivate.git (push)
staging git@heroku.com:testivate-staging.git (fetch)
staging git@heroku.com:testivate-staging.git (push)

A few days I go, a deployment broke my production app, so I used heroku rollback, finally created the staging app I am using now, and pushed my code to the staging app, presumably with git push staging master. (This was a few days ago but I'm pretty sure that's what I did.)

It's all working now on my staging app, so I'm trying to push my code to my production app.

However, Heroku keeps telling me that my production app is already up-to-date:

$ git branch
* master

$ git status
# On branch master
nothing to commit (working directory clean)

$ git add .
$ git add -u
$ git commit -m "trying to commit"
# On branch master
nothing to commit (working directory clean)

$ git push heroku master
Everything up-to-date

$ git remote show staging
* remote staging
  Fetch URL: git@heroku.com:testivate-staging.git
  Push  URL: git@heroku.com:testivate-staging.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local ref configured for 'git push':
    master pushes to master (up to date)

$ git remote show heroku
* remote heroku
  Fetch URL: git@heroku.com:testivate.git
  Push  URL: git@heroku.com:testivate.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local ref configured for 'git push':
    master pushes to master (up to date)

I know that Heroku is wrong however, because there are some clear-as-day changes to my views which you can see in my local code and on the staging server, but not on my live production app.

For example, compare the "back" link that is correctly here in my staging app, but not here in my production app.

How do I get Heroku to update my production app as I want?

Thanks,

Steven.

解决方案

Are you sure you're referring to the correct branch? Here's the syntax of the actual command:

git push heroku <the branch you wish to push>:<the branch on the heroku server you wish to push to>

So if you're used to running

git push heroku master

and you checkout and commit to a branch other than master, running git push heroku master will push your unchanged master branch. Instead, run

git push heroku the_branch_i_changed:master

这篇关于为什么Heroku认为一切都是最新的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆