I’ve recently set up a git deploy. Gitolite maintains bare git repos and separate staging/production repositories pull the recent changes when a hook is triggered.
This obviously takes place while there are visitors on the website. Could it theoretically happen, that with many requests, the source files would be locked continuously and git would never have the opportunity to replace them, thus not deploying the new version? Should I make sure the files are not in use or git actually can replace the files that are in use?
Files are served/read by recent nginx and php-fpm.
You don’t state how the files are being served up to users? Assuming you’re using something like Apache, then unix does not perform any file locking of files being read. You should be fine.