What does the --stdlayout do in git svn clone?
I just spo开发者_JS百科tted this question about recovering from a clone done without --stdlayout. I didn't find documentation of this flag - what does it do?
Subversion doesn't have any concept of branch or tag. Instead, those are typically simulated by simply copying the contents of the repository into a directory.
In order for git svn
to be able to recognize branches and tags and the main branch ("trunk"), you have to explicitly tell it where to find them, using the --tags
(or -t
), --branches
(or -b
) and --trunk
(or -T
) options.
However, many Subversion repositories follow a standard convention, laid out in the Subversion book, of --trunk=/trunk --branches=/branches --tags=/tags
. --stdlayout
(or -s
) encodes this convention, so that you don't have to pass the same arguments every time you clone a Subversion repository.
You can find this information in the git-svn(1)
manual page, which you can access under Unix with man git-svn
and in an operating system independent fashion via the builtin Git help system with git help svn
. All of the Git man pages are also available on Kernel.Org and they are usually the first search result when you search for git-svn(1)
.
--stdlayout
(-s
) tells git-svn
that folders in /branches
should be imported as branches, and that folders in /tags
are snapshots of a project state and should be imported as tags. The master branch will be set to /trunk
.
It's equivalent to --trunk=trunk --tags=tags --branches=branches
精彩评论