Reputation: 14061
The .git directory (such as the refs directory and HEAD file) are fairly critical to git. Is it possible to track the .git directory using its own object store? This w/could exclude (ignore) the objects directory itself, and perhaps the index.
Thus the .git directory structure would be with the git objects and recoverable from the content of those objects alone [Is that true for all the objects including pack and info dirs?]. Hence a simple copy and rename of all the objects to some innocuous file names, e.g. image0001.raw, image0002.raw, or dump0001.raw, etc., would allow you to maintain (recover) your git repo in a challenging environment (e.g. pressure to only use the existing paid-for big iron CMS)
Edit: looks like what-after-git-unpack-objects-to-get-the-actual-file gets close to my use case ;-)
Upvotes: 1
Views: 253
Reputation: 318508
There is no need to backup the .git
folder of a local repository:
If you break your repository, you simply clone it from the remote repo again. If you have no remote repo, simply create a local clone and push to it from time to time.
Upvotes: 1
Reputation: 375574
Git already takes care of those internal files itself. How would putting them into yet another git repo help anything?
Upvotes: 3