Using git checkout-index to init project from boilerplate repository
As developers, we are always looking for inspiration in other people’s code. Either we learn something totally unfamiliar to us, or we are just in for a trick, but what makes us better developers is the social aspect of coding.
There are a lot of boilerplate repositories that put together several libraries into a starter package for new projects. So how do we use them as efficiently as possible?
So the first step would be to clone it. Business as usual.
$ git clone firstname.lastname@example.org:numerogeek/ultimate-symfony2-boilerplate.git
Old school folks would recursively remove
.git folders at this point. But not us. Let’s see what git awesomeness there is in our sleeve:
$ git checkout-index -f -a --prefix=/work/webdev/kickstart/
This will create the
/work/webdev/kickstart/ folder and copy all the files there, without the
Now we can safely navigate to our destination folder
$ cd /work/webdev/kickstart/
and continue with
$ git init
and then add everything to the repo
$ git add .
$ git commit -m "initial setup
We’re ready to go, and not starting from scratch!