Note that there are some explanatory texts on larger screens.

plurals
  1. POGit backups: can I copy a git bare repository while it's being pushed to?
    text
    copied!<p>At our firm, we're experimenting with moving from svn to git. We want to make this simple for teams, while not burdening the sysadmins too much. </p> <p>We've found a way to do this by making a bare repository on a (Windows) network drive that each team has, and push/pull to/from that. Authentication is arranged through file access permissions, so no need to set up https and the whole auth stuff. Great! (and we can access the drive remotely via VPN, so it's really almost as good as a https or git+ssh solution)</p> <p>Better yet, we'll even get backups for free, because the network share is already being backed up. However, this backup runs rather unpredictably (backup up lasts several hours, so might continue onto the next working day).</p> <p>Thus, it is possible that the drive is being backed up <em>while</em> a developer is pushing to the repository. With SVN, this could cause problems, which is why <code>svn hotcopy</code> exists. </p> <p>Does the same risk exist with git? Can I copy a bare repository somewhere while someone is pushing to it? Naturally, it's all right if the push-being-done cannot be restored. It's also fine if some work has to be done to restore a backup that was made while it was pushed to (i.e. by removing the half-done push residue data). But if the entire bare repository becomes broken and unusable, then that's a problem.</p> <p>I've done some experiments and couldn't see problems, but this does not mean that there can't be any.</p> <p><strong>Edit:</strong> I accepted a 'do it the right way' answer, because that's what I intend doing in the long run. For now, however, for us a simple solution has been to <code>git clone</code> the entire bare repository (onto the same drive) about an hour <em>before</em> the automated backup kicks in. The automated backup may incorrectly copy the "real" repository if it has been in use at that point, but it will not have trouble with the recently cloned copy. We know when the backup starts, just not when it ends, so that's good enough for us.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload