I've a git repo and I want to tar all the files except .git folder and its contents.
I've found answers with param exclude=... in tar.add(...) but it seems to be depricated. Any other ways to do it?
I think you can do find files and skip files and use exec command to tar.
find /dir -name "*.gz" ! -name .git -exec tar -rvf out.tar {} \;
Python: tarfile exclude .git folder inside tar