问题
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