Create a gzipped tar archive:
tar -czvf /path/to/file.tar.gz ./stuff-to-archive
List contents of a gzipped tar archive:
tar -ztvf file.tar.gz
Extract contents of a gzipped tar archive:
tar -zxvf file.tar.gz
Create a gzipped tar archive:
tar -czvf /path/to/file.tar.gz ./stuff-to-archive
List contents of a gzipped tar archive:
tar -ztvf file.tar.gz
Extract contents of a gzipped tar archive:
tar -zxvf file.tar.gz
You can, of course, use –exclude and avoid adding the .git folders to your tar archive, but I discovered a really cool option that excludes the folders created by a whole host of version control systems:
--exclude-vcs
Which, as of version 1.32, means excluding CVS, RCS, SCCS, git, SVN, Arch, Bazaar, Mercurial, and Darcs as follows: