Many frameworks offer a seed or boilerplate that can be cloned to jumpstart development of a new app. Often, the recipe goes something like
Step 1: Clone our fancy boilerplate that extends the power of this super easy and advanced framework by incorporating the industry's best practices while decoupling the framework from the hindrances we all thought were needed, providing you the cleanest possible slate to start building your super app.
git clone https://github.com/user/magic-super-easy-and-advanced-framework-seed
Step 2: Download and build in some extra bloat that couldn't be bundled with the magic we used to create the boilerplate but nonetheless is required and used by the industry's best practices which you will therefore also need to use to make your app the most super
...
Step 3: Start building your super app, just like that!
Step 4 (optional): Profit
What I think all of these boilerplate instructions are missing is the step for removing the boilerplate's git
cruft. Wouldn't it be better if my new super app didn't have the history of the boilerplate? What is the proper way to clone a boilerplate but otherwise start the project fresh with a clean git history and no references to the boilerplate?
Note that unlike git workflow - using one repo as the basis for another, I'm not just looking for removing references to the boilerplate repo in git's remotes, but all references to and commit history of the boilerplate repo.
If you want to delete your git history, the best way I can think of to do it is to do the following.
rm -rf .git
git init
git add .
git commit -m "whatever"
That way you clean out the old history, ensuring no bloat follows you around, and start from what you've got downloaded when you start your super app.
When you don't want to import the whole history of a git repository, you can use
git clone --depth 1 <repository>
to create a so-called shallow-clone with only the most recent revision. Optionally you can also use --single-branch
to omit any branches except master.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With