【问题标题】:extra branches created by git svn clonegit svn clone 创建的额外分支
【发布时间】:2013-07-28 17:10:04
【问题描述】:

从我的previous question 继续,我决定继续并重新克隆thing

$ git svn clone --branches=Branches/Wrye\ Bash/* \
--tags=Tags/Wrye\ Bash/* \
--trunk=Programs/Wrye\ Bash/ --prefix=svn/ \ 
--ignore-paths="^(?:Releases|Projects|Scripts|Games|)/|^Programs/\
(?:Nif Scanner|Nif Viewer|Raziel23x's Oblivion Toolset|Shader Disasm|Shader Editor)/" \
--authors-file=authors_with_emails.txt \
svn://svn.code.sf.net/p/oblivionworks/code/ . >> 2013.07.28 2>&1

所以现在我只克隆了一个带有分支和标签的特定项目

结果:

$ git branch -a
* master
  remotes/svn/291-fixes
  remotes/svn/294.2%20bugfixes
  remotes/svn/294.2-3329021
  remotes/svn/295-3329021
  remotes/svn/295-fixes
  remotes/svn/296-unicode
  remotes/svn/302-fixes
  remotes/svn/dev-sharlikran
  remotes/svn/tags/274
  remotes/svn/tags/276
  remotes/svn/tags/288
  remotes/svn/tags/289
  remotes/svn/tags/290
  remotes/svn/tags/291
  remotes/svn/tags/291.1
  remotes/svn/tags/292
  remotes/svn/tags/293
  remotes/svn/tags/294
  remotes/svn/tags/294.1
  remotes/svn/tags/294.1.test
  remotes/svn/tags/294.2
  remotes/svn/tags/295
  remotes/svn/tags/295.1
  remotes/svn/tags/295.2
  remotes/svn/tags/295.3
  remotes/svn/tags/295.4
  remotes/svn/tags/295.5
  remotes/svn/tags/296
  remotes/svn/tags/297
  remotes/svn/tags/297.1
  remotes/svn/tags/298
  remotes/svn/tags/299
  remotes/svn/tags/300
  remotes/svn/tags/301
  remotes/svn/tags/302
  remotes/svn/tags/302.1
  remotes/svn/tags/302a
  remotes/svn/tags/303
  remotes/svn/tags/304
  remotes/svn/trunk

Branches/Wrye\ Bash/ 文件夹只包含:

291-fixes
294.2-3329021
295-fixes
302-fixes
dev-sharlikran

那么remotes/svn/294.2%20bugfixesremotes/svn/295-3329021remotes/svn/296-unicode 是从哪里弹出来的?

r1947 = 435203c3dc4c8a608e3a33d325afd2013549fd34 (refs/remotes/svn/trunk)
Found possible branch point: svn://svn.code.sf.net/p/oblivionworks/code/Programs/Wrye%20Bash => svn://svn.code.sf.net/p/oblivionworks/code/Branches/Wrye%20Bash/296-unicode, 1947
Found branch parent: (refs/remotes/svn/296-unicode) 435203c3dc4c8a608e3a33d325afd2013549fd34
Following parent with do_switch
Successfully followed parent
r1948 = c5e6069b46f9501478e0f354c9956092be3e407f (refs/remotes/svn/296-unicode)
    M   Mopy/bash_default.ini
# etc

complete log

编辑: 另一个问题:我应该为那些创建本地分支吗?
忘了说我现在打算把它作为一个 git-svn 桥,但最终作为一个完整的迁移 - 所以我想尽可能正确地做到这一点

注意我不是在谈论@branches

【问题讨论】:

    标签: git svn git-svn


    【解决方案1】:

    那么 remotes/svn/294.2%20bugfixes、remotes/svn/295-3329021 和 remotes/svn/296-unicode 是从哪里弹出来的?

    来自 SVN 存储库 :-)。严重的是,这些分支存在于“Branches/Wrye Bash”下,但后来在 SVN 中被删除。

    如果在 SVN 存储库中删除了一个分支,git-svn 将不会删除相应的 git 分支(因为否则该分支及其所有 [未合并] 提交将在 git 中丢失)。

    如果这些分支困扰您,您将不得不手动删除它们。参见例如How can I make git-svn get rid of remote branches that don't exist anymore?

    编辑:另一个问题:我应该为那些创建本地分支吗?

    通常,如果您想提交本地分支,您只需要创建一个本地分支。所以不需要提前创建本地分支,想干就干。

    【讨论】:

      猜你喜欢
      • 2021-10-06
      • 1970-01-01
      • 2016-07-11
      • 2012-01-08
      • 2011-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-08
      相关资源
      最近更新 更多