如何捆绑一个完整的回购 [英] How to git bundle a complete repo

查看:90
本文介绍了如何捆绑一个完整的回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将完整的回购转移到新的非联网机器,最好作为单个文件实体。 git bundle允许在sneakernet环境中执行 git fetch git pull 样式操作,但似乎假设您已经拥有一个在目标机器上回购的工作版本。



什么是正确的调用:


  1. 在当前仓库中捆绑所有分支

  2. 启动目标目录上的新仓库,即正确安装根仓库提交 li>


解决方案


什么是正确的调用:




  • 捆绑当前仓库中的所有分支机构

简单:

  $ git包创建repo.bundle --all 

这里 repo.bundle 是要创建的包文件的名称。请注意, - all 不包含远程跟踪分支......就像普通的克隆不会一样。



< blockquote>

  • 启动目标目录上的新回购,即获得正确安装的根提交


首先, clone 只是 init + <$ c

其次,您可以在任何可以使用存储库URL的地方使用包文件,因此您可以简单地克隆从包文件中获得:

  $ git clone repo.bundle 

这将创建 repo 作为git存储库。

I need to transfer a complete repo to a new non-networked machine, preferable as a single file entity. The git bundle allows a git fetch, git pull style operation in a sneakernet environment but appears to assume that you already have a working version of the repo on the destination machine.

What is the right invocation to:

  1. Bundle all the branches in the current repo
  2. Start up the new repo on the destination directory, i.e. get the root commit correctly installed

解决方案

What is the right invocation to:

  • Bundle all the branches in the current repo

Simple:

$ git bundle create repo.bundle --all

Here repo.bundle is the name of bundle file you want to create. Note that --all would not include remote-tracking branches... just like ordinary clone wouldn't either.

  • Start up the new repo on the destination directory, i.e. get the root commit correctly installed

First, clone is just init + fetch (+ administrativia).

Second, you can use bundle file everywhere the repository URL can be used, so you can simply clone from a bundle file:

$ git clone repo.bundle

This would create repo as a git repository.

这篇关于如何捆绑一个完整的回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆