Re: File versioning based on shallow Git repositories?
- From
- Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no>
- Date
- Apr 12, 2018, 19:36 UTC
- Message-ID
- <4af21bcd-7a68-50df-4cce-0b050ccaeb90@usit.uio.no>
- In-Reply-To
- <87d0z4b6ti.fsf@evledraar.gmail.com>
On 12. april 2018 20:47, Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
> 1. Create a backup.git repo > 2. Each time you make a backup, checkout a new orphan branch, see "git > checkout --orphan" > 3. You copy the files over, commit them, "git log" at this point shows > one commit no matter if you've done this before. > 4. You create a tag for this backup, e.g. one named after the current > time, delete the branch. > 5. You then have a retention period for the tags, e.g. only keep the > last 30 tags if you do daily backups for 30 days of backups. > > Then as soon as you delete the tags the old commit will be unreferenced, > and you can make git-gc delete the data.
Nice! Why the tags though, instead of branches named after the current time?
One --orphan branch/tag per day with several commits would work for me.
Also maybe it'll be worthwhile to generate .git/info/grafts in a local clone of the repo to get back easily visible history. No grafts in the original repo, grafts mess things up.
-- Hallvard