I don't think you need to choose between those because they are totally different things, therefore they're not subtitudes of each other.
- git is a version control system, nothing more. It cannot publish anything on it's own, and it does not provide tarballs nor web interface either.
- tarball is just an archive, not capable of keeping logs of changes and you cannot distribute those without a webserver / ftp server etc.
Now there are code hosting services like github, gitlab and notabug which are web frontends for git. Those can do both: they can provide you a remote git repository as well as a tarball. For example
-
https://github.com/fogleman/Craft.git is for the remote repository, you can use it with "git clone" (could be a "git://" or "ssh://" url as well)
-
https://github.com/fogleman/Craft is a web page which uses the repository's files as contents for the generated HTML
-
https://github.com/fogleman/Craft/archive/refs/heads/master.zip is an url of a tarball that the code hosting service generates from the repo
All the additional features (web page and tarball) are provided by the code hosting service, not git. For example, you can install
gitlab portal on your own webserver, there's no need to use the official gitlab.com server, and it can generate tarballs (not only zip, but classic tar.gz tarballs too.)
But you could also have a remote git repository on the server, and no code hosting engine at all, just a ca. 100 SLoC php code to generate the latest tarball. That way you can have a git and a tarball too, without the web interface.
Or you could just run git locally, run tar on your machine and upload it to a static webserver.
Or just keep local files, run tar and use a static webserver.
There are advantages and disadvantages:
local git + code hostingEasy workflow, backup of your code, not have to worry about tarballs (they always contain the latest because they are generated)
local git + own webserver + own code hosting portalEasy workflow, backup of your code, not have to worry about tarballs, plus no 3rd party has your code (you're running the gitlab portal on your own server)
local git + remote git + tarball generationEasy workflow, backup of your code, not have to worry about tarballs, plus no 3rd party has your code (you're running remote git on your server), but there's no code browsing web interface for your code, only the tarball urls work
local git + local tarball generation + static webserverNo backups (!), plus you have to pay attention if you've uploaded the latest tarball or not
no git + local tarball generation + static webserverWorst of all. No versioning, no backups (!), manual checking for latest tarballs.
Hope this answers your question.
Cheers,
bzt