--stdlayout 在 git svn clone 中有什么作用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5361559/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 05:13:12  来源:igfitidea点击:

What does the --stdlayout do in git svn clone?

svngitgit-svn

提问by ripper234

I just spotted this questionabout recovering from a clone done without --stdlayout. I didn't find documentation of this flag - what does it do?

我刚刚发现了这个关于从没有 --stdlayout 完成的克隆中恢复的问题。我没有找到这个标志的文档 - 它有什么作用?

回答by J?rg W Mittag

Subversion doesn't have any concept of branchor tag. Instead, those are typically simulated by simply copying the contents of the repository into a directory.

Subversion 没有branchtag 的任何概念。相反,这些通常是通过简单地将存储库的内容复制到目录中来模拟的。

In order for git svnto 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.

为了git svn能够识别分支和标签以及主分支(“主干”),您必须使用--tags(or -t)、--branches(or -b) 和--trunk(or -T) 选项明确告诉它在哪里可以找到它们。

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.

但是,许多 Subversion 存储库都遵循 Subversion 书中规定的标准约定,即--trunk=/trunk --branches=/branches --tags=/tags. --stdlayout(或-s) 对这个约定进行编码,这样您就不必在每次克隆 Subversion 存储库时都传递相同的参数。

You can find this information in the git-svn(1)manual page, which you can access under Unix with man git-svnand in an operating system independent fashion via the builtin Git help system with git help svn. All of the Git man pagesare also available on Kernel.Org and they are usually the first search result when you search for git-svn(1).

您可以在git-svn(1)手册页中找到此信息,您可以在 Unix 下man git-svn通过内置的 Git 帮助系统以独立于操作系统的方式访问git help svn所有 Git 手册页也可在 Kernel.Org 上找到,它们通常是您搜索git-svn(1).

回答by knittl

--stdlayout(-s) tells git-svnthat folders in /branchesshould be imported as branches, and that folders in /tagsare snapshots of a project state and should be imported as tags. The master branch will be set to /trunk.

--stdlayout( -s) 告诉git-svn文件夹 in/branches应该作为分支导入,并且文件夹 in/tags是项目状态的快照,应该作为标签导入。master 分支将设置为/trunk.

It's equivalent to --trunk=trunk --tags=tags --branches=branches

它相当于 --trunk=trunk --tags=tags --branches=branches