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?
Have a look first at
If you want the archive to include the files tracked by git, but not the git repository itself or any generated or otherwise untracked file, then use
If you specifically want to exclude
With GNU tar (i.e. under Linux or Cygwin), you can shorten this to
The POSIX way of creating archives is