News for hackers. Stuff that matters.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by Sohcahtoa82 on Tuesday October 12, 2021 @11:19AM (#28840805)
That's dangerous unless you've properly configured your web server to block access to your .git directory.
Re:Ask HN: Solo-preneurs, how do you DevOps to save time? by handrous on Tuesday October 12, 2021 @11:34AM (#28841016)
Safer/easier to keep the .git somewhere else entirely, rather than in the working directory. Git's got arguments that let you do that. Then you can check out to a dir that doesn't have the .git dir in it at all.

Alternatively, it's pretty easy to use git-archive (optionally, with an exclusions list to keep out files you don't want to serve publicly) to do something similar without ever cloning the remote repo. You can fetch a zip or tar.gz with a given commit's files, straight from a remote repo.