How to compact .git directory in git
<p>Here is the respective size of directories inside of a Rails app that I have inherited:</p>

<pre><code>→ find . -maxdepth 1 -type d -mindepth 1 -exec du -hs {} \;
263M    ./.git
2.0M    ./app
124K    ./config
728K    ./db
4.0K    ./doc
 56K    ./lib
  0B    ./log
232K    ./public
8.0K    ./script
164K    ./spec
560K    ./spreadsheets
 16K    ./test
 64K    ./vendor
</code></pre>

<p>I made a new repository off an existing repository branch on Github and left the old one intact.  <strong>I do not need any history in the new repository</strong> since that particular branch of the old repository became the master for the new repository and that is the only branch in the new repository.  I would like to get the size of .git to a minimum size to start with since it is an absolute waste in terms of Github space, local space, and Heroku deployment.</p>

<p>Git init did not work.  I do not know if I can just</p>

<pre><code>rm -rf .git
</code></pre>

<p>and then reinitialize the git repository and then push it to Github remote.  </p>