Rarely used git commands

How to export all repository files to a directory?

git --work-tree=${OUTPUT_DIRECTORY} --git-dir=${REPOSITORY_DIRECTORY}/.git checkout -f

How to export all repository files to an archive?

git archive --prefix="${result_directory}/" -o ${result_archive}.tar.gz HEAD

links