-2

My question:

Why isn't Heroku giving me the master branch when cloning? Could it be that Heroku has a build that is not the master branch and that it serves this other build and actually gives me the master branch but does not serve it? Shouldn't Heroku always give you the master branch when cloning and build and serve the master branch?

To make clear what I have done:

When I clone the repository of my heroku site and then push it back without any changes, the site brakes.

I follow the instructions, heroku git:clone -a august9. Everything seems to be downloading, I get some files, but not the files that are served when I go to the web site.

When I push (git push heroku master) a 'change', like changing some text in the README.md file , which should not really matter, the site brakes. When I then roll back (heroku rollback), the site is fine again.

Background: Last summer I wanted to test Heroku, so I started making an app and haven't worked on it since then. Now I have some spare time and want to continue developing. I found the old folder on my machine, did a commit and a push, just to check that it was the right folder. The site broke. So it must be the right folder. I rolled back. The site was working again. I created a new folder, cloned the heroku repository, commited some minor changes and the site broke again.

1 Answers1

0

I solved the problem by finding a previous commit that had the files that actually is served. I still don't know why the files in my master branch was not served.

Anyway here is what I did:

  1. git log (to find a previous commit that had all the served files)
  2. git branch tmp (made a new branch of the detached head)
  3. git merge -s ours master (merging tmp and master and keeping the local version when there is a conflict)
  4. git checkout master
  5. git merge tmp
  6. git push heroku master

This answer was inspired by this answer: How to replace master branch in git, entirely, from another branch?

Community
  • 1
  • 1