git - 如何解绑一个 git 包?

标签 git bundle 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/*

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

关于git - 如何解绑一个 git 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42840041/

相关文章:

javascript - Eclipse:创建新的 JavaScript 文件错误

git - 无法从远程服务器 pull

rubygems - 我无法安装 ffi gem - MacOS Big Sur 11.0.1

git - 使用 git-bundle 传输对多个分支所做的更改

git - 忽略已经提交到 Git 存储库的文件

git - Jenkins 管道子模块身份验证

android - 通过 bundle 传递 TIME 对象

git - 从多个 git bundle 文件创建 repo

git - 跟踪文件但从 git 包中排除它们