I've seen lots of people say you can backup git repositories by just copying them, but what happens if you are copying the repository at the same time that someone is pushing some changes up to it?
Basically what will happen is that you will get the complete repo at the time of copy. If there is a partial transaction hanging around from a push at time of copy it will be cleaned up as a failed transaction, just like you had lost a network connection while pushing to a remote repository.
If you're worried about concurrency, it should be quite safe to instead use
git clone /my/repository/location /my/backup/location
As every git repository has a complete copy of everything, it's an effective backup which is guaranteed (at least as much as git itself is!) to be concurrency-safe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With