Recently I had to export the latest version of a project from a bare Git repository. As it seems like there is no equivalent to svn export in Git, I had to look for an alternative. After some searching I found the following solution:
$ cd ~/example.git $ git archive master | tar -x -C /path/to/target/folder
The first part of this statement creates a tar archive with the content of the master branch. The second part then extracts this archive to the specified folder (-x means “extract”, and -C means “change to directory”).
I hope this is useful for some of you!