Git LogoAnother one of my Git complaints (up until now) was that I didn’t know how to export a repository so that it excluded all of the .git files/folders (similar to the way that svn export works). Well, another one bites the dust.

git checkout-index -a -f --prefix=/path/to/folder/

Make sure the –prefix folder path includes a trailing slash.

–prefix supports relative paths as well.

I should also add that you should make sure you commit your latest changes, or they won’t be included – even if they’re saved. This is probably obvious, but I sometimes overlook the obvious :)