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条回答
forever°为你锁心
2楼-- · 2019-01-16 18:34

If you're using Java, don't forget to rebuild the project before pushing.

In case of Gradle:

gradlew clean install
查看更多
Root(大扎)
3楼-- · 2019-01-16 18:36

Kindly confirm your current branch is master.

 git branch 

If the pointer is not pointing the master, then check out to master branch

git checkout master

Commit your changes and try to push to heroku

git commit -am "xxxyyzzz"    
git push heroku master
查看更多
SAY GOODBYE
4楼-- · 2019-01-16 18:37

had the same issue, what worked for me was: make a commit with a random message and then push

git commit -m"random message"

git push heroku master
查看更多
何必那么认真
5楼-- · 2019-01-16 18:37

Same issue, I added a remote to my local repository with the heroku git:remote command and then pushed it.

heroku git:remote -a your-heroku-app

git push heroku master
查看更多
▲ chillily
6楼-- · 2019-01-16 18:41

Even though this is an old issue, I wanted to update with what worked for me (a newbie) should anyone else run into this:

After following the instructions here (from Hudson), what finally did the trick for me was doing a "git pull" after checking out the "master" branch. Perhaps "git push heroku master" pushes out only the local branch of master?

Of course, this assumes all required changes have been correctly merged into your master. I hadn't pulled from master on my local since the project set up because all merges (from development to master) were handled on GitHub and I had been working on new branches that were later merged with development.

So, to restate steps above from Hudson:

git checkout master

git pull

(here, I updated README to have a change to commit, like "Heroku deploy [date, time]"

git add .

git commit -am "xxxyyzzz"

git push heroku master

heroku run rake db:migrate

heroku restart

Good luck!

查看更多
趁早两清
7楼-- · 2019-01-16 18:42

I had a similar issue and by no means my changes were visible on heroku. To reconfirm myself I even took a clone from heroku and it was obviously up to date.

I could resolve my issue only by following this approach:

Step 1: Make a new branch from master

git checkout -b new_branch

Step 2: Just add a comment in any file to make a new commit and then:

git add .
git commit -m "Just a test commit to push new branch to heroku"

Step 3: Push the new branch to heroku.

git push heroku new_branch:master
heroku restart

You could now see your changes successfully on heroku.

查看更多
登录 后发表回答