I just spotted this question about recovering from a clone done without --stdlayout. I didn't find documentation of this flag - what does it do?
The git svn clone command transforms the trunk, branches, and tags in your SVN repository into a new Git repository. Depending on the structure of your SVN repo, the command needs to be configured differently.
# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With