Incremental backups with git bundle, for all branches

后端 未结 4 1152
春和景丽
春和景丽 2020-12-05 05:20

What is the easiest way to do incremental backups of a git repository with git bundle?

If I just wanted to backup a single branch, I could do something

4条回答
  •  暖寄归人
    2020-12-05 05:56

    Try using --since with --all.

    Create the first backup:

    git bundle create mybundle-all --all
    

    Do an incremental backup:

    git bundle create mybundle-inc --since=10.days --all
    

    The incremental should contain all commits on all branches that have happened in the past 10 days. Make sure the --since parameter goes back far enough or you might miss a commit. Git will also refuse to create the bundle if no commits have happened in that time-frame, so plan for that.

提交回复
热议问题