I\'ve been wondering whether there is a good \"git export\" solution that creates a copy of a tree without the .git
repository directory. There are at least thr
I have another solution that works fine if you have a local copy of the repository on the machine where you would like to create the export. In this case move to this repository directory, and enter this command:
GIT_WORK_TREE=outputdirectory git checkout -f
This is particularly useful if you manage a website with a git repository and would like to checkout a clean version in /var/www/
. In this case, add thiscommand in a .git/hooks/post-receive
script (hooks/post-receive
on a bare repository, which is more suitable in this situation)