There is a huge issue with this approach though - **you now have only one single
commit, and you’ve lost the commmit history!**
This means that you lose the story and context of how the project was developed,
and what decisions and changes were made during the lifetime of the project so
far. Also, if multiple people developed it, now there is only one person being
attributed - the one who made the single new commit.
Also, if I’m considering adding your module to my project, personally I’m less
likely to do so if I only see one "initial commit". I’d like to see the activity
from the days, weeks or months prior to it being released.
What this does allow though is to easily remove references to client names etc
before pushing the code.
## Use a subtree split
An alternative method is to use [git-subtree][0], a Git command that "merges
subtrees together and split repository into subtrees". In this scenario, we can
use `split` to take a directory from within the site repo and split it into it’s
own separate repository, keeping the commit history intact.
Here is the description for the `split` command from the Git project itself:
> Extract a new, synthetic project history from the history of the <prefix>
> subtree. The new history includes only the commits (including merges) that
> affected <prefix>, and each of those commits now has the contents of <prefix>
> at the root of the project instead of in a subdirectory. Thus, the newly
> created history is suitable for export as a separate git repository.
<divclass="note"markdown="1">
__Note__: This command needs to be run at the top level of the repository. Otherwise you will see an error like "You need to run this command from the toplevel of the working tree.".
To find the path to the top level, run `git rev-parse --show-toplevel`.
</div>
In order to do this, you need specify the prefix for the subtree (i.e. the
directory that contains the project you’re splitting) as well as a name of a new