Tar a folder without .git files

gittar

If I tar a folder that is a git repository, can I do so without including the .git related files? If not, how would I go about doing that via a command?

Best Answer

Have a look first at git help archive. archive is a git command that allows to make archives containing only git tracked files. Probably what you are looking for. One example listed at the end of the man page:

git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz
Related Question