Git & external backup. Subdirectory is empty, I'd rather it not be.

前端 未结 1 431
遥遥无期
遥遥无期 2021-01-28 03:30

I would like to use Git for creating an external backup system.

This was inspired in part by the answer at What is the best way to back up an entire git repository on e

相关标签:
1条回答
  • 2021-01-28 03:51

    Submodules are repos recorded in a parent repo as gitlinks (special entries in the index, mode 160000), that is as the exact SHA1 represented by that submodule repo.

    The goal is not just to include a subrepo, but to include a specific version of that repo (hence the gitlink, to record the right SHA1 to which that subrepo should be checked out).

    In your backup-script scenario, you should go in each submodule, and backup in their own bare repo on your external drive.

    You will find the path of those submodules in your .gitmodules file in the main repo.

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