How to perform application-consistent backup of Git repo

0

Imagine I have a bare Git repository on my own hosted server that is used by multiple folks for cloning, pushing, and pulling. What commands would be necessary to get such a repository into a state for performing a snapshot as described in the link below in reference to an application-consistent backup?

I envision I need Git commands for the following tasks when locking:

  • Prohibit pushes from other users.
  • Allow any pushes currently occurring to complete.

I envision I need Git commands for the following tasks when unlocking:

  • Resume allowing pushes from other users.

I've been looking into the differences between crash-consistent backups and application-consistent backups.

It seems application-consistency is needed for applications such as databases in which some quiescing time is needed along with controlled locking and unlocking in order to get the application into a state ready to perform the snapshot.

I'm not asking here whether or not such an activity is necessary for Git; I feel that's more of an opinion than a fact.

What I'm asking here is what Git commands are necessary and in what order in order to support an application-consistent backup of Git repos on a server.

jia103

Posted 2018-10-05T03:24:49.483

Reputation: 415

Answers

0

  1. Git does not have any commands for locking|unlocking workflow for repository (because just doesn't support this model as any other DVCS)
  2. Terms "*-consistent backups" (both forms) are not applicable to repo-data - it's just data in some state… or any state, maybe
  3. Git is transaction-based, thus - all "in progress" operations just don't exist until the complete transaction is completed
  4. Consequence of 1-3: plain git clone|git pull (for new|existing fork) will be enough for you in order to get consistent backup for HEAD (in time) revision of SRC-repository

Lazy Badger

Posted 2018-10-05T03:24:49.483

Reputation: 3 557