使用具有.git目录的存储库的subgit [英] Using subgit with repositories having .git directory

查看:216
本文介绍了使用具有.git目录的存储库的subgit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想让我的Git仓库拥有.git子目录,我很困惑如何使用subgit。

I'm confused how to use subgit if I want my Git repository to have a .git subdirectory.

如果我使用传统的子项配置 +(子目录导入子目录安装),它不创建 .git 目录。

If I use the conventional subgit configure + (subgit import or subgit install), it doesn't create a .git directory.

如果我首先执行 git init ,那么我可以执行 subgit import ,但它似乎并没有让我先执行 subgit configure ,并且我想设置我的配置文件,所以我不必把一堆在code> subgit import 。

If I do git init first, then I can do subgit import but it won't seem to let me do subgit configure first, and I want to setup my configuration file so I don't have to put a bunch of stuff in the command-line for subgit import.

的命令行中可以找到 subgit 为传统的 .git 目录使用所有的存储库资料?

Is there a way to tell subgit to use the conventional .git directory for all the repository stuff?

推荐答案

您应该总是将SubGit安装到 bare 存储库。要创建一个裸仓库,可以使用 git init --bare 命令。或者,您可以指定不存在或空目录为 subgit configure 命令,并且SubGit将在其中创建一个裸Git存储库:

You should always install SubGit into a bare repository. To create a bare repository use git init --bare command. Alternatively you can specify non-existing or empty directory to subgit configure command and SubGit will create a bare Git repository at it:

$ subgit configure --svn-url <SVN_URL> non-existing-directory.git
$ subgit install non-existing-directory.git

然后,您应该设置Apache或SSH以访问此存储库或将其克隆到本地以获取具有 .git / 目录和工作树的存储库。

Then you should setup Apache or SSH to give access to this repository or clone it locally to get a repository with .git/ directory and working tree.

我还会注意到, subgit import 大多是到 subgit configure + subgit install + subgit uninstall 命令,因此只需一次性导入即可使用

I would also note that subgit import is mostly a shortcut to subgit configure + subgit install + subgit uninstall commands, so for just one-time import you can use

$ subgit import --svn-url <SVN_URL> non-existing-directory.git

这篇关于使用具有.git目录的存储库的subgit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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