git push heroku master says “Everything up-to-date

2019-01-16 17:51发布

I have an app on Heroku that is running old code. I've made a small change and committed the change. I then ran

git push heroku master

It'll say

Fetching repository, done.
Everything up-to-date

But if I go and look at the app, it's all old code. I did revert the site back to another version in Heroku about 15 days ago, but pushed updates to it since then and they worked.

Why is heroku not getting the most current files from my github repository? Is there a way to just reset the app and push the files from github again? I have production data in the database so I do NOT want to touch it.

Thanks in advance!!

12条回答
Explosion°爆炸
2楼-- · 2019-01-16 18:21

When this happens, I push previous commit hash like:

git push some-heroku-app-name ee3bca189acec89f5e9b098692ab6cee386a8f25:master --force

Then I re-push master like this:

git push some-heroku-app-name master:master
查看更多
爱情/是我丢掉的垃圾
3楼-- · 2019-01-16 18:22

I'm willing to bet you've forgotten to run git add . followed by git commit -m 'xyz'?

查看更多
贪生不怕死
4楼-- · 2019-01-16 18:26

Try:

heroku status

This returned the following, which confirmed that the problem was with the heroku API (and not with my app!):

"The API is experiencing delays. This may result in delays with adding new domains, new releases, and other such actions. Currently, engineers are investigating the issue."

查看更多
Bombasti
5楼-- · 2019-01-16 18:26

I know, I know, silly, but it happened to me so I'm leaving a warning to others: make sure the app you're pushing to is the same app you're checking for changes.

In my case I was pushing to staging and then running a shell on production and not understanding why the static files didn't change.

(It started with a real issue where static files didn't change when I pushed a new version, but it was probably a one-push fluke, and it only kept me going in circles for another hour because I was testing the wrong app.)

查看更多
Melony?
6楼-- · 2019-01-16 18:26

My executable name had changed but I forgot to change the name in my Procfile. So while all the files were updating correctly in heroku, the same old executable was running. I used heroku local from the command line to help track that issue down.

查看更多
Root(大扎)
7楼-- · 2019-01-16 18:31

When you run git push heroku master, git is assuming that you are pushing from master, so if you changes are in other branch, you will try to push your master branch without changes.

You have two options

1.Merge your changes with master and push them.

Commit your changes in your actual branch, then merge them with master

git commit -a - m "your messages"
git checkout master
git merge your_feature_branch
git push heroku master

2.Push your changes from your actual branch

git push heroku your_feature_branch:master
查看更多
登录 后发表回答