If you are coming from a sysadmin point of view, what your friend suggests is best. Only a filesystem backup including all permissions etc. will make sure that recovering after an outage is 100% possible, quick, and can be done easily by your regular sysadmin team, whose job it is to worry about backup&recovery in the first place.
(Also make sure to disable incoming pushes while the backup is running, of course, as usual.)
Yes, you could also simply git clone
, but that won't get the whole environment; i.e. if you are using ssh authentication (~/.ssh/authorized_keys
), you need to get that too (even more so if you are using other git servers, like GitLab or whatever). git hooks are not automatically fetched by a git clone
and so on, there may be more.
EDIT: the file system backup should of course contain anything that is remotely (sic) related to git. I.e., the complete /home/git
(or whichever user git is running under), /var/git_repos
(or wherever you are keeping your repositories) and so on. Enough so if you set up a cleanly installed machine you can get everything back and running just by recovering those directories.