Git Exercises
gitexercises.fracz.com
Git Exercises
1–10 of 23 posts
Re: Git Exercises
#2Re: Git Exercises
#3Re: Git Exercises
#4Maybe I'm misremembering, but I don't remember people having so much trouble with svn. With rcs and cvs, sure, and it was mainly stuff with breaking locks, moving files, and other BS that were part of the bad design. With svn I remember the problems being: setting up the daemon (https vs svnserve+ssh), fixing a wedged Berkeley DB when that was still a thing, and getting hook scripts working right cross-platform. With git, the common problem seems to be: "what command am I even supposed to use here?" and "I broke it somehow and I don't know how to fix it." If the number of articles about it ever seemed to go down I might say, "Oh, it's just growing pains for new users," but they still seem to be out there constantly. Why is everybody still having trouble learning to use git?
Note to the zealots: This isn't to say git is bad, anymore than vi/vim is bad for having it's own arcane interface that users have complained about and struggled with for decades. Lots of terrific software carries burdens like a terrible interface, or an onerous configuration, or a lack of documentation. That doesn't mean we can't be critical.
Re: Git Exercises
#5This is actually pretty well done, but I can't help but feel like the number of articles and documents trying to explain or teach git is a sign that the tool just has usability problems. Maybe I'm misremembering, but I don't remember people having so much trouble with svn. With rcs and cvs, sure, and it was mainly stuff with breaking locks, moving files, and other BS that were part of the bad design. With svn I remem…
I think the fact is that many people have worked with git on their own, and then they may think that they know git.
Many of those people then go on to work on a small project with hardly any devs working concurrently on the same code, but just enough to run into problems they didn't have before. This way you get the brightest of those people to start to understand that no, unless you've worked on a Git project with a team and handled the issues that comes along with that experience, you don't actually know Git yet.
Unfortunately with smaller teams, those people often learn Git so well (and, to be fair, "so well" is only marginally better than the person who works on Git by themselves, but getting to know it that well is still a substantial barrier, because git merge conflicts are pain, and pain is naturally avoided, but one can only learn to solve a problem by rote, ... by rote, or by repeating the solution.)
...that the rest of their team often doesn't have to learn the hard parts at all. That person then "handles the git issues." You don't really need to get Mad Git Skillz if you don't have a need to deal with those issues, and if your company's core competency is solving git merge conflicts, then you know you have a problem... anyway...
As team size approaches "the Linux kernel" or similarly byzantine and gargantuan project scope, the frequency of having "those issues" increases and the absolute number of "git people" needed to handle them obviously goes up. Maybe if you're lucky, the proportion of people who know Git well enough to solve the hard problems also goes up, so as a member of the team, your frequency of encountering a Git Person who might impart some Git Wisdom onto you will also go up.
Git isn't only good for teams that need to solve hard problems like OS kernels though. Some teams don't ever need to solve especially hard problems (not to belittle those teams, and notwithstanding that "complex" and "hard" can be separate, and the domain of hard problems is vast and many teams that do solve "hard" problems still don't need to solve hard git problems.)
But they still know they need Git to do their jobs. Those teams may learn enough Git, then dodge the bullet and never "get a Git person" and they are absolutely still really using Git productively.
They're using Git to solve a problem that it solves, they're just not using Git to solve hard problems. They may even get really good at avoiding encountering those hard problems before they ever need to spend the time to learn to solve them, from repeated exposure to let's call them "merge traumas."
And you will get successful teams on both ends of the spectrum.
Not to stray too far from the topic at hand, this site and the exercises look great. I like the mix of easy and hard problems. I like that the word "rebase" is nowhere to be found on the front page, but as a person who knows how to use rebase (and struggles to explain it to my team sometimes) it was very easy to find the exercise that will teach it, and see that it is not an especially difficult example at all.
The fact that Git is successful I think can be attributed strongly to the fact that Git can make solving some very hard problems possible and with great ease, when you have become "a git person."
Re: Git Exercises
#6This is actually pretty well done, but I can't help but feel like the number of articles and documents trying to explain or teach git is a sign that the tool just has usability problems. Maybe I'm misremembering, but I don't remember people having so much trouble with svn. With rcs and cvs, sure, and it was mainly stuff with breaking locks, moving files, and other BS that were part of the bad design. With svn I remem…
What makes the issue most clear to me is just looking at the language used in various git commands, and asking how related it is to the abstract task I'm actually trying to accomplish. More often than not, the choice of words makes sense in connection with the implementation of various git operations, but has no relation to the task you're attempting to accomplish.
I believe that situation is a consequence of the UI being centered around several data structures at the heart of git's operation. So, if you learn, first, that those data structures exist at all, how they're used, and how the various commands relate to them—then you can start becoming proficient at git, and the language used in the commands makes a kind of sense even from a design perspective.
IMO, the main thing missing is a way of seeing git's core data structures updated in real-time as you perform various operations on them. Instead we mostly rely on manually kept mental models of them—and on making backups before trying new things ;) I think this project I'm working on could potentially work really well for giving a real-time visualization of git's data structures: http://symbolflux.com/projects/avd (not that I can imagine any realistic route for incorporating it with the git codebase, though...—but in principle.)
Re: Git Exercises
#7Re: Git Exercises
#8This is actually pretty well done, but I can't help but feel like the number of articles and documents trying to explain or teach git is a sign that the tool just has usability problems. Maybe I'm misremembering, but I don't remember people having so much trouble with svn. With rcs and cvs, sure, and it was mainly stuff with breaking locks, moving files, and other BS that were part of the bad design. With svn I remem…
What is a simple (or should I say easy?) workflow that allows three (or three hundred) people to work on the same codebase? I'd challenge that there isn't one, and that sometimes a complex problems has a complex solution. I think the fact is that many people have worked with git on their own, and then they may think that they know git. Many of those people then go on to work on a small project with hardly any devs wo…
Re: Git Exercises
#9Earlier quoted context omitted.
What is a simple (or should I say easy?) workflow that allows three (or three hundred) people to work on the same codebase? I'd challenge that there isn't one, and that sometimes a complex problems has a complex solution. I think the fact is that many people have worked with git on their own, and then they may think that they know git. Many of those people then go on to work on a small project with hardly any devs wo…
Look at Mercurial for an example of an interface that is much better, and it accomplishes basically the same thing as git.
> Rewriting of history has ramifications if you’ve previously pushed those commits elsewhere. In Mercurial, you simply cannot push commits that you later intend to rebase, because anyone pulling from the remote will get them. In Git, you may push commits you may want to rebase later (as a backup) but only if it’s to a remote branch that only you use. If anyone else checks out that branch and you later rebase it, it’s going to get very confusing.
Git does not tell me what I cannot do. Can you explain how this documentation is wrong, or how I'm wrong for what I want to do here? I'm talking about "git pull --rebase"
Because in Git, I know that canonical wisdom is you should not rebase a branch once it's published, but Git does not tell me what I cannot do, and it happens all the time ("Committer, master has moved some since your PR was submitted, please pull rebase.") Out of respect for contributors time (and some of whom won't know what to do, and may spend time struggling to figure it out...), I would probably not rewrite a commit that's been published in a master branch, but I will absolutely rewrite commits all the time on branches that are not yet merged.
So, can you explain how this workflow goes in Mercurial? (Or why it's unnecessary?) Because from briefly perusing the first document I could find about my question, it looks like Mercurial cannot be used to solve this problem (the solution of which, I find to be a fundamental and very important part about how Git works.)
Re: Git Exercises
#10Earlier quoted context omitted.
Look at Mercurial for an example of an interface that is much better, and it accomplishes basically the same thing as git.
I went looking for Mercurial documentation about how to rebase and found this: > Rewriting of history has ramifications if you’ve previously pushed those commits elsewhere. In Mercurial, you simply cannot push commits that you later intend to rebase, because anyone pulling from the remote will get them. In Git, you may push commits you may want to rebase later (as a backup) but only if it’s to a remote branch that on…