如何拆分 git 捆绑包?

How to unbundle a git bundle?

我刚刚通过电子邮件收到了一个 Git 包裹。我如何解开它以便阅读它?我在使用 unbundle 命令时遇到问题。我试过了

git unbundle *bundle name* 

但这给了我一个奇怪的代码

eae0b00697e53cd87c871143051673f3ee413148  

和refs/heads/master

I am having trouble using the unbundle command.

你根本不应该运行这个命令。

I just received a Git bundle via email. How do I unbundle it in order to read it?

这在the git bundle documentation中有描述:

EXAMPLE

Assume you want to transfer the history from a repository R1 on machine A to another repository R2 on machine B. For whatever reason, direct connection between A and B is not allowed, but we can move data from A to B via some mechanism (CD, email, etc.). We want to update R2 with development made on the branch master in R1.

To bootstrap the process, you can first create a bundle that does not have any basis. You can use a tag to remember up to what commit you last processed, in order to make it easy to later update the other repository with an incremental bundle:

machineA$ cd R1
machineA$ git bundle create file.bundle master
machineA$ git tag -f lastR2bundle master

Then you transfer file.bundle to the target machine B. Because this bundle does not require any existing object to be extracted, you can create a new repository on machine B by cloning from it:

machineB$ git clone -b master /home/me/tmp/file.bundle R2

This will define a remote called "origin" in the resulting repository that lets you fetch and pull from the bundle. The $GIT_DIR/config file in R2 will have an entry like this:

[remote "origin"]
    url = /home/me/tmp/file.bundle
    fetch = refs/heads/*:refs/remotes/origin/*

有关其余说明,请参阅其余文档。请注意,在此示例中 you 是 "machine B";机器 A 上的其他人已经完成了前几个步骤。 (他们做对了吗?我不知道;你呢?)