Git versus Mercurial for .NET developers?

前端 未结 7 2116
挽巷
挽巷 2021-01-31 17:19

I\'ve been wondering what is the better DVCS for .NET developers? From reading various information it has sounded like Mercurial works better on Windows, but other information

相关标签:
7条回答
  • 2021-01-31 17:38

    I think that given git's exponential popularity growth, git's good support for windows (akin to that of subversion's with something like tortoiseSVN) is bound to arrive, it is only a matter of time. The two projects that seem to be the most popular are msysgit, and TortoiseGit (also uses msysgit) which is similar to tortoiseSVN. git keeps becoming more and more popular, that if you were to run into any problems which is unlikely now and is becoming even more unlikely as git tools on windows become further developed, you will be able to find fixes a lot easier due to the large userbase.

    In the meantime, I have found this series of guides to be very helpful.

    Issues you might run into may be ignoring certain files, which should be easy if you lookup how to use .gitignore, which is really straightforward, here is the list of files and wildcards that the series mentions:

    obj
    bin
    _ReSharper.*
    *.csproj.user
    *.resharper.user
    *.resharper
    *.suo
    *.cache
    *~
    *.swp
    

    Also I have seen some issues regarding line endings. For that, you will want to check out this question.

    0 讨论(0)
  • 2021-01-31 17:38

    Both Git and Mercurial will do fine for a .NET developer, but it's well-known that Mercurial has better Windows support. Also, if you consider a commercial tool, why don't you take a look at Plastic SCM reading the following tutorial on distributed dev on Windows? http://codicesoftware.blogspot.com/2010/03/distributed-development-for-windows.html Update Now Plastic SCM has a FREE Community Edition.

    0 讨论(0)
  • 2021-01-31 17:43

    I have been using Mercurial for over a year now for doing .NET development, and it has been working out great. I do admit I don't use any of the fancy tools (explorer add-ons and Visual studio tools), but they are available (e.g. TortoiseHg). I have found that using the command line tools is just as easy - just specify a few wildcards in .hgignore (as in Blaenk's answer) and you're good to go.

    I'm not sure how well git integrates with hg, but for the reverse siutation I have used hg-git in the past and it worked fine. It is however still somewhat unstable as new releases of hg come out.

    So you should be able to use github from mercurial, and for native mercurial repos there is always the (imo) equally nice bitbucket.org. Edit: Note also that codeplex, which is focused on .NET open source projects, now offers Git and Mercurial repositories.

    And I should mention that "popularity" is a very difficult criterion to base your choice on. Either DVCS has high-profile users. Git has the linux kernel, of course, while notable hg users include the mozilla and Python projects.

    EDIT: Since this seems to get regular upvotes. Everything I wrote above was true at the time of writing, but I no longer agree with my former self bitbucket is as nice as GitHub. GitHub has better functionality, and from my point of view (mostly F# open source development) everyone else is there so you get much better network effects. I moved all my project from codeplex/bitbucket to GitHub a while ago and immediately started getting contributions, whereas on codeplex/bitbucket next to nothing happened.

    0 讨论(0)
  • 2021-01-31 17:48

    I haven't used Mercurial seriously, but have just finished switching to Git from Subversion for .NET development. The distribution that I'm using is Git Extensions, which install the standard (msys) Git, plus a graphical frontend, some Windows Explorer integration, and a Visual Studio plugin. It also ships with good docs. The Explorer integration doesn't provide the neat status markers on file icons that TortoiseSVN does, but just adds the essentials to the right-click menu. All of these tools are working fine.

    The biggest issue I've found is that Git requires you to understand the concepts to get good results. The graphical interfaces of Git Extensions are just thin shells over the Git facilities, so if you struggle with, say, submodules, then none of the tools provided by Git Extensions will solve that problem. There are now loads of tutorials and videos about Git online, though.

    By default Windows builds of Git convert line endings to CRLF; as we are completely an MS shop this is the right behavior for us.

    0 讨论(0)
  • 2021-01-31 17:53

    At the time of writing, I've used both TortoiseGit and TortoiseHg (for mercurial) in different projects, dominantly java and .net projects. I have to say that TortoiseHg is in the lead as it is much more stable and fully featured of the two.

    There is a Mercurial plugin for Visual Studio 2008, but I'd suggest sticking with TortoiseHg until the plugin itself is stable. Not sure about integration with git, but there is some talk about a plugin for VS here.

    0 讨论(0)
  • 2021-01-31 17:55

    Git has a major advantage that will make life easier while using VS, the rename detection, if you want to just use Command Line interface, In HG you have to rename the files when you rename it in VS, in Git will detect your renames seamlessly (it tracks contents not files), even you do some changes in the file it will detect the rename as well.

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