title: How do I reset a Heroku git repository to its initial state?
body: <p>I have got a web application within a git repository. Due to historic reasons the web application is not at the root of the repository, it is within a folder called <code>website</code>. Beside that there are some other folders, so that I have got the following structure:</p>
  
  <pre><code>myApp
  +- .git
  +- otherFolder1
  +- otherFolder2
  +- otherFolder...
  +- otherFolderN
  +- website
  </code></pre>
  
  <p>The website is run on Heroku. As Heroku demands that your web application is at the root of a git repository, until now I used a build process which copied the <code>website</code> folder to a completely different (external) folder with its own git repository. Then I was able to push from there to Heroku and everything was fine.</p>
  
  <p>Now, since git includes the <code>subtree</code> command this is not necessary any longer, as I could directly push from my initial folder, but just the <code>website</code> sub-folder, using:</p>
  
  <pre><code>git subtree push --prefix=website heroku master
  </code></pre>
  
  <p>Basically, this works perfectly. I only have one problem: As the previous commits to Heroku came from a completely different git repository, the history of both doesn't match each other - so Heroku detects a non-fast-forward push, and rejects the <code>subtree</code> push.</p>
  
  <p>So how do I deal with this?</p>
  
  <ul>
  <li>Idea 1: Force push. Tried that, but doesn't work as <code>git subtree push</code> does not have a <code>--force</code> option (or anything similar).</li>
  <li>Idea 2: Clear Heroku's repository and start from scratch again.</li>
  </ul>
  
  <p>I'd love to go with idea 2, but I have no idea of how to achieve this.</p>
  
  <p>My first approach was to run a <code>git push heroku :master</code>, but Heroku detects this and denies it.</p>
  
  <p>Of course, I could destroy the app and recreate it, but then all domain assignments and add-ons are gone as well, and I'd like to avoid that.</p>
  
  <p>Any other ideas?</p>