intsilence
V2EX  ›  问与答

最近遇到 SVN MERGE 的一个坑,问下如果使用 GIT 会不会有类似的问题?

  •  
  •   intsilence · Nov 20, 2015 · 2401 views
    This topic created in 3832 days ago, the information mentioned may be changed or developed.

    复现这个坑的过程:
    1. trunk 上有文件 a.txt ,使用 SVN COPY 创建分支。
    2. trunk 上使用 SVN MOVE 把 a.txt 改名为 b.txt 。
    3. 在分支上修改 a.txt 内容,并提交。
    4. 把分支合并到 trunk ,此时 SVN 会提示 Skipped missing target: 'a.txt',如果此时进行提交,在分支上所有对 a.txt 的修改会丢失。

    遇到这个坑之后,我稍微搜索了一下发现这是 SVN 的一个遗留问题,直到今天( 1.9 版本)都没解决。下面第二个链接中,说是考虑在 1.10 版本中修复这个问题。

    http://stackoverflow.com/questions/187454/subversion-not-merging-changes-into-renamed-files
    http://subversion.tigris.org/issues/show_bug.cgi?id=898

    我对 git 不是很熟悉,所以请教下各位,如果使用 git 进行版本管理,遇到类似的问题 git 会如何处理呢?

    2 replies    2015-11-21 10:41:10 +08:00
    justfly
        1
    justfly  
       Nov 20, 2015
    会报冲突 解决冲突 提交即可
    intsilence
        2
    intsilence  
    OP
       Nov 21, 2015
    @justfly git 能识别出来就好, SVN 直接丢弃代码真是太坑了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3015 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 12:30 · PVG 20:30 · LAX 05:30 · JFK 08:30
    ♥ Do have faith in what you're doing.