git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How to efficiently backup a bare repository?

From
Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
Date
Nov 23, 2018, 10:23 UTC
Message-ID
<CA+BUw6gjfpiHhy+jYzxeO4NDOKiMUH0XZ3-c5o7ygdKBCKWm2Q@mail.gmail.com>
Hi,
I'm managing many bare repositories for development teams.

One service we want to offer is to let developers retrieve old state of the repository up to 30 days. For example, one developer (accidently) removed (push -f) a branch/tag and realize few days later (after vacations) that it was an error.

What is the best approach to do this?
Currently, we use a classical approach, backuping all the repo every
day. But this is far from efficient as:
- we accumulate 30th copies of the repository
- due to packing logic of Git, even if the content is mostly similar,
from one backup to another, there is no way to deduplicate.

Is there any tricks based on reflog? Even for deleted refs (branch/tags)? Is there any tooling playing with the internal of git to offer such feature, like copying all refs in a timestamped refs directory to retain objects?

Thanks in advance for any tips letting improve the backup.
-- 
Guilhem BONNEFILLE
-=- JID: guyou@im.apinc.org MSN: guilhem_bonnefille@hotmail.com
-=- mailto:guilhem.bonnefille@gmail.com
-=- http://nathguil.free.fr/
Next: Ævar Arnfjörð Bjarmason
Message 1 of 3 in “How to efficiently backup a bare repository?”
  1. Guilhem BonnefilleNov 23, 2018
  2. Ævar Arnfjörð BjarmasonNov 24, 2018
  3. Junio C HamanoNov 25, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.