在 git svn clone 中使用 --no-metadata 有优势吗?
我正在使用 git svn clone 进行从 SVN 存储库到 Git 存储库的单向转换。大多数示例都使用 --no-metadata
标志来执行此操作 - 使用此标志有优势吗?
据我所知,该标志删除了 SVN 修订号。我可以想到保留这些内容可能有用的原因(例如参考错误跟踪软件中提到的特定提交)。
使用 --no-metadata
标志的参数是什么?除了打破所有联系的感觉之外,还有什么好处吗?
I'm doing a one-way convert from an SVN repository to a Git repository using git svn clone
. Most examples do this with the --no-metadata
flag - is there an advantage to using this flag?
I understand that the flag removes the SVN revision numbers. I can think of reasons why it may be useful to keep these around (such as referring back to specific commits mentioned in bug tracking software).
What are the arguments for using the --no-metadata
flag? Is there any benefit other than a sensation of breaking all ties?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
--no-metadata
的一个理由是它不会更改您的提交消息。因此,即使您从不同的位置获取,提交消息也将是相同的,因此提交哈希值将是相同的。举个例子,如果我从本地
file:
URL 中git svn init
一个存储库,然后从https:
URL 中提取,则每次提交存储库将被复制,因为所有带有git-svn-id: file:///
... 的提交都将作为git-svn-id: https:// 获取/
...并用 new 编码SHA1 的。如果我指定
--no-metadata
那么提交消息和这个 sha1 将是相同的,我可以从本地文件系统或 subversion 服务器获取,因为任何内容都只有一个副本git repo 中给出了 svn commit。就我个人而言,我更喜欢有一个最小元数据选项,它记录了颠覆版本ID,但不是完整的元数据,但又不会与
git-filter-branch
混在一起我们要么全有,要么一无所有。One argument for using
--no-metadata
is that it doesn't change your commit messages. So even if you fetch from different locations, the commit messages will be the same and thus the commit hashes will be the same.As an example, if I
git svn init
a repo from a localfile:
URL and later pull from anhttps:
URL, every commit in the repo will be duplicated, since all of the commits withgit-svn-id: file:///
... will be fetched asgit-svn-id: https:///
... and encoded with new SHA1's.If I specify
--no-metadata
then the commit message and this sha1 has will be the same and I can fetch from either the local filesystem or the subversion server because there will only be a single copy of any given svn commit in the git repo.Personally I would prefer it if there were a minimal metadata option, which recorded the subversion revision id, but not the full metadata, but without messing around with
git-filter-branch
we are stuck with all or nothing.其实不推荐:
It is actually not recommended: