Renaming in Git and Mercurial: Accuracy and automaticity

前端 未结 2 1297
没有蜡笔的小新
没有蜡笔的小新 2021-01-12 20:26

I only have a few days of experience with Git and Mercurial, and I don\'t have much programming experiences.

In the past few days, I read many posts that comparing t

相关标签:
2条回答
  • 2021-01-12 20:53

    Here you can see the difference explained, but mostly you are right. Mercurial has rename and mv commands that do "real" renaming, while Git's mv just does rm and add. Also seems like Mercurial can mimic Git behavior and guess your renames, quite nice feature. From experience Git's rename detection algorithm makes wrong decisions a lot - especially if you copy a file and alter the two copies a little - most of the time it will be wrong.

    0 讨论(0)
  • 2021-01-12 20:57

    I don't think that Mercurial's ability to track file renames is nearly so perfect as you seem to think it might be. I don't have much experience with Git, but I do have a good bit with Mercurial, and renaming files seems to work OK in some contexts (hg view understands them), so long as you haven't done anything too "interesting" (which seems to happen somewhat frequently).

    And Git, by reputation at least, is supposed to let you make low-level changes to history if you need to.

    0 讨论(0)
提交回复
热议问题