Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset Heroku app and re-commit everything?

I'm building an application which I'm also testing in Heroku. I ran into some problem today and had to rollback one commit in my local git repo, but Heroku now won't recognize my changes saying that "everything is up to date".

So, running

git push heroku master

heroku responds with

Everything up-to-date

which isn't true.

UPDATE: Things I've tried

git push -f heroku master
git push --force heroku master
git push heroku +master
git push --force heroku +master

Did some changes in the source code and then

git add.
git commit -a -m "Message" #(Then this commit shows in my git explorer)
git push heroku master #Everything up-to-date
like image 462
bruno077 Avatar asked May 23 '11 23:05

bruno077


3 Answers

Sounds weird. Maybe try pushing a different branch would do?

git branch production
git checkout production
#do some code changes
git commit -am "some desperate code changes to try fix heroku"
git push heroku production:master

Creating a new production branch is what I want you to test. Besides, it's nice to have a production branch that you can use to deploy.

If it doesn't work, then I think the problem runs deeper and you need help from heroku.

EDIT: Add the heroku releases addon too. Rolling back is as easy as heroku rollback

like image 187
oma Avatar answered Nov 09 '22 05:11

oma


This doesn't work in all situations, but if your local repo has diverged from the Heroku repo such that git can't figure out how to reconcile the two -- like if you rebased your local branch after it was pushed to Heroku -- you can force a push by putting a plus sign + before the ref, like this:

git push heroku +master

It may not work in your case, but it's worth a try.

like image 36
Rob Davis Avatar answered Nov 09 '22 05:11

Rob Davis


This worked for me (from https://coderwall.com/p/okrlzg):

  1. Run heroku plugins:install https://github.com/lstoll/heroku-repo.git
  2. heroku repo:reset -a APPNAME

From there, the git repository has been "reset". Next, run:

  1. git push heroku master -a APPNAME

to seed the git repository and re-deploy your app.

like image 26
Jeremy Thomas Avatar answered Nov 09 '22 06:11

Jeremy Thomas