Tarballing without Git metadata

You will get a nasty surprise when the number of files increase to more than one xargs command: Then you will first make a tar file of the first files and then overwrite the same tar file with the rest of the files.

GNU tar has the --exclude option which will solve this issue:

tar cvf ~/app.tar --exclude .git --exclude "*.log" .

Leave a Comment