restoring git repository from bundle backup

后端 未结 3 1778
情歌与酒
情歌与酒 2021-01-31 08:32

i created backups of my git repository like in How to backup a local Git repository? proposed with

git bundle create /tmp/foo-all --all

I can s

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-31 09:25

    Bundle contain not files, but deltas, you need the base in order to recreate the file content. You have to clone first, unbundle later. Init instead of clone allowed only in case, where bundle requires 0 refs

    Don't ignore git bundle verify before unbundling

    git-bundle(1) - Linux man page

    Used to check that a bundle file is valid and will apply cleanly to the current repository. This includes checks on the bundle format itself as well as checking that the prerequisite commits exist and are fully linked in the current repository. git bundle prints a list of missing commits, if any, and exits with a non-zero status.

    If you are creating the repository, then you can clone from the bundle as if it were a remote repository instead of creating an empty repository and then pulling or fetching objects from the bundle

提交回复
热议问题