Renaming in Git and Mercurial: Accuracy and automaticity

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 the two. Based on what I’ve read and my tests, I get the following conclusions:

  • git problem : fatal: Unable to write new index file
  • Cleaning up debug commits in git
  • Backup all branches in a git repository keeping what has been rebased and forced
  • Git pull until there is something to pull
  • copy a git repository without revisions (without .git and .gitingore) from a remote server
  • Delete git master branch on a private server (not GitHub)
  • Git’s renaming is 100% automatic but not 100% accurate. It relies on algorithm to guess renames. The end users are not able to alter its decision even if it’s completely wrong.

    I guess Git’s method might be fine for 99% of the cases, but that 1% are going to cause headaches. It makes me hesitate to refactor my code (changing class name and contents at the same time), as I’m risking losing file history if refactor too much.

    Mercurial can be 100% automatic and 100% accurate, as long as I always rename/move my stuffs inside Visual Studio and have VisualHG installed, VisualHG should accurately and automatically track moving and renaming (currently VisualHG has a bug – File is not renamed when I move it between projects). And the end users can change it’s decision if it makes mistakes.

    If I don’t have Visual Studio I can still use TortoiseHg’s “Detect Copies/Renames” window, I can set a similarity percentage, ask Mercurial to automatically detect renames. If it makes mistake, I have the chance to correct it.

    Are my conclusions right or wrong?


    Git and Mercurial – Compare and Contrast

  • How to retrieve the branch where a commit was created originally using LibGit2Sharp?
  • git server with eclipse project
  • Is there a good way to restrict read (fetch) on per branch basis in git?
  • Android Studio Update Project: Merge vs Rebase vs Branch Default
  • Startup script on EC2
  • What is a signed commit?
  • 2 Solutions collect form web for “Renaming in Git and Mercurial: Accuracy and automaticity”

    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.

    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.

    Git Baby is a git and github fan, let's start git clone.