Transferring changes made to multiple branches using git-bundle

前端 未结 1 1428
迷失自我
迷失自我 2020-12-20 02:46

I was looking for git-bundles as an option to keep my 2 repositories (being continuously worked on) in sync with each other.

Since both are two different geographica

相关标签:
1条回答
  • 2020-12-20 03:09

    You can create a new backup while excluding what was in the previous backup:

    git fetch ../backup.bundle
    git bundle create ../newbackup.bundle ^backup/A ^backup/B A B C
    

    Here you create an incremental backup with incremental history for branches A and B, plus the new branch C.

    You can see that approach detailed in "Incremental backups with git bundle, for all branches"

    I prefer the simpler approach of using the date of the last backup:

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

    It is ok to backup "a bit more": duplicate commits won't be imported twice when you will use that incremental backup.

    I have made a script based on --since: save_bundles.

    0 讨论(0)
提交回复
热议问题