Can we set a single file as external in Subversion?

后端 未结 4 2028
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 08:58

Can we set a single file as external in Subversion?

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 09:39

    As mentioned in the first answer, SVN Externals are documented in Chapter 3 of the SVN Book, and quite a few syntax examples are given there.

    In addition, this note is given:

    "Because the svn:externals property has a multiline value, we strongly recommend that you use svn propedit instead of svn propset."

    In my experience testing Tortoise SVN v1.9.6 and svn.exe v1.9.5, the results are as-documented.

    • Bringing in an external folder with all its files works.
    • Bringing in a single file from the same repo works.
    • Bringing in a single file from a different repo fails and this limitation is documented in the SVN book.

    This leads to a clumsy workaround. If you control both repos, you can clone an individual file into its own folder in the source repo (by Externals of a single file WITHIN a repo), and then Externals it across repo borders into the target repo by bringing in its entire folder, which contains only a single file.

    Docs for doing this with the Tortoise SVN client are on tortoisesvn.net.

提交回复
热议问题