0

I have a small demonstation application which I am running on Heroku's free service.

It was all working, and I made some changes, deleting unneeded files and tidying everything up, but something I did messed up everything on Heroku, as it wasn't serving static files after that. I tried numerous things to fix it, but I can't get them to work.

So I have now gone back to the last working state, using the following on my laptop:

git reset --hard <commit-id>

I managed to push this to Heroku with :

git push heroku --force

And now it is working.

My problem is, that I want to reset my master branch to this state, and start removing files (more carefully this time). When I try to commit the changes, then push it gave me an error:

rejected non-fastforward

What do I need to do to make this previous commit the most up to date one? (Git terminology would be appreciated, as I am sure there is a name for this but I don't know it).

wobbily_col
  • 11,390
  • 12
  • 62
  • 86

1 Answers1

1

I suspect that your problem is that you have rewritten history on a branch that was pushed to a remote repo. (Using git revert is safer)

To get your branches back in sync, either merge or rebase, depending on what you want.If you have a specific problem, provide more details.

Related questions:

Git reset --hard and a remote repository

Git push rejected "non-fast-forward"

Git push failed, "Non-fast forward updates were rejected"

When should I use git pull --rebase?

Community
  • 1
  • 1
drRobertz
  • 3,490
  • 1
  • 12
  • 23