$ git archive master | tar x -C /path/to/dir/to/export

Jan. 12, 2012, 11:04 a.m.Janos


The git archive command basically creates a tar file. The one-liner is to create a directory instead, without an intermediate tar file. The tar command above will untar the output of git archive into the directory specified with the -C flag. The directory must exist before you run this command.