Using subgit with repositories having .git directory

安稳与你 提交于 2019-12-08 11:17:08

问题


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

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

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.

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


回答1:


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

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.

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


来源:https://stackoverflow.com/questions/29203392/using-subgit-with-repositories-having-git-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!