Re: Incremental Backup of repositories using Git
- From
Justin Tobler <jltobler@gmail.com>
- Date
- May 5, 2025, 16:18 UTC
- Message-ID
- <2dz3cema2mr5mrlvuroemnyeqyrglxfmusfdz2kaghv6rvj3ro@ti2dhu45fdmr>
- In-Reply-To
- <PH7PR19MB70252D42F5D04FFC0331AB63C08E2@PH7PR19MB7025.namprd19.prod.outlook.com>
On 25/05/05 02:35PM, Akash S wrote:
Show 7 quoted lines
> Hi, > > Currently we are backing up repositories using the "git clone -bare" command and save it to disk. If we want to restore, we just run git push -mirror from the repo that was saved during the backup. > > Currently we are running full backups (run git clone -bare) everyday, which is taking a lot of disk space and time. > > Are there any possible ways to backup only the incremental changes of a repository? And somehow construct the whole repository when we want to do a restore from the incremental backups?
You could look into using git-bundle(1) to create incremental bundles using exclusions. Examples:
# Creates a bundle containing the last 10 commits for main. $ git bundle create inc-backup main~10..main
# Creates incremental bundle based on time for all references. $ git bundle create inc-backup --all --since=7.days
These bundles can then be "unbundled" into a repository as long as the repo contains the required prerequisite objects.
-Justin
> > Thanks, > Akash >