The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,319 other followers

Why the Heck is Git so Hard? | Probably Done Before

Posted by jpluimers on 2014/02/04

Why the Heck is Git so Hard? | Probably Done Before is wonderful, especially as it points to workspace • Git Cheatsheet • NDP Software.

And I really like this hacker news comment on it:

MBCook 1 hour ago | link

> 3. \”You just don\’t understand Git\’s model\” Well many programmers barely understand what a compiler does yet they are capable of writing software.

I really do think this is the issue. I\’ve been using git for about a year, but I was never confused about what it was doing because I understood it. I eagerly watched the developed back when the whole Bitkeeper thing came to a head. Not only did I see the start, I saw the situation it was born in.

Git is a uni-directional acyclic graph for tracking patches.

Git was designed around the model the Linux kernel had used, sending patch sets around. You merge people\’s patch sets in, you re-base an existing patch set on the current development, you figure out what the difference is.

Since Git tracks all those patches (which everyone calls commits), it has a full history of them. That history is a simple graph that always moves forward.

The distributed stuff (like origins, remotes, etc) is just a way of formalizing all the \”look at my tree\” stuff that the kernel guys did.

The basic model really is quite simple (the command line certainly has a few warts), the distributed stuff makes a fair amount of sense, and the patches aspect fits in really well.

I think the problem is that most people come to it from the CVS/SVN model. Commits in those systems are more permanent, where as the patches floating around the LKML were always more ephemeral; you could try to apply them at any point if you could fix the merge issues. I actually wonder if borrowing so much of the existing version control system vocabulary made things worse.

Commits are patches. \’Staging\’ is the stuff you haven\’t send to the mailing list yet. Branches are long series of patches. Merging is accepting patches, and re-basing is apply a patch set against a different starting point.

If you go straight from \”This is what CVS does\” to \”This is what Git does\”, you miss why Git works like that. Whenever your mental model doesn\’t match reality (in this case, how Git operates) you end up with frustration and confusion.


via: Why the Heck is Git so Hard? | Hacker News.

2 Responses to “Why the Heck is Git so Hard? | Probably Done Before”

  1. Rich Shealer said

    I started using SVN at my previous employer. It was a small two person programming department, but we found that we ran into issues with conflicts and breaking commits. It is hard to commit something small when it breaks something else you are going to be working on shortly. However when you ewait too long the more likely your changes will conflict with the other programmers changes.

    When I changed jobs, one of the first things I looked at was Git and Mercurial. After consideration I went with Mercurial. Partially based on Joel Spolsky’s Mercurial tutorial, and on the advice of others that it didn’t matter in the long run.

    One nagging thing has bugged me is that Visual Studio added native support for Git and will not be doing so for Mercurial. I only have about six projects that have been done with Mercurial. I think there are ways to convert the repository and history if I wanted.

    As I continue down the path I wonder if I should turn around to get on the other road before I really have to or wish I had heeded the obvious road signs. Or is the real point that it still doesn’t matter in the long run and time spent on futzing with another VCS is time not spent on more pressing issues.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

<span>%d</span> bloggers like this: