When using tar
it’s very important to obey the order of the options.
The last option always has to be “f
” to indicate the file we want to be created. If you want to exclude some files or folders you can’t either place the --exclude
option before the compress “c
” option. What’s the solution then? Placing it in the middle like so:
tar czvp --exclude='.git' -f folder.tar.gz folder