5 ms·
A practical Git introduction
- josephjrobison 12y agoMaybe I'm still very rudimentary, but as a beginner trying to understand git off and on for the last few months, this is still too advanced to understand up front.
- mrchlblng 12y agoCould you be a little more explicit about what you find too advanced or what specific points would need more explanations? I intend to use this as a course material for git total beginners so your feedback is very important to me!
- chrisBob 12y agoThis intro is easy to follow, and explains things well. I only work on smaller projects at the moment, but it is a little embarrassing to admit that the closest thing I have to version control is some combination of dropbox and time machine recording my old files. I will probably start by having Xcode create and manage a local repository, but it is also useful to know what is behind that.
- mattip 12y agoThe main gripe I have with many git tutorials is how quickly I am exposed to git internals, before even describing how to do basic things like "get the last commit id" or " find where a file changed". I am only slightly interested in the tree structure used to store my data, and as a beginner much more interested in cooperative work flow with a group of developers.
- kinghajj 12y agoTo me, it is one of Git's strengths, that it's internal data structure is simple enough to describe and understand, and doing so brings great clarity to the rest of its operations. For example, knowing that "creating a branch" is literally just writing 40 bytes to a file makes them much more approachable.
- privong 12y agoBut the parent's point is that this internal data structure is irrelevant to the absolute beginner, who is trying to figure out how to use git, as opposed to figuring out how git works under the hood. It is great that the internal data structure is fairly simple, but that does not necessarily mean it should be brought up so early in tutorials. It can be a turn off to people who are learning version control tools for the first time.
- mrchlblng 12y agoFrom my experience, most people issues with git is because they do not really understand how it works (or try to apply what they've seen with other cvs). Now I agree that having to understand internals might be seen as an engineering failure, however * internals are pretty quick to cover * for students learning software development, I thought it would be interesting to see that you can have very few low-level objects that offer powerful high-level actions
- privong 12y agoI can see where those things would be interesting for students learning software development, but not everyone who uses git is doing that type of development. To be fair, I am coming at this from the standpoint of someone who uses git for science, rather than software development. Yes, I use it to track changes in code, but vast majority of that code is scripting analysis procedures (so knowing about internal data structures does not directly help me do my job). I also use git to track changes in LaTeX manuscripts. So, while your first point is arguably universally applicable (that knowing the internals would help me use git), the second point does not apply to everyone. I am not suggesting that all tutorials should jettison an early discussion of the git internals, but merely suggesting that including such a discussion early on, may not be appropriate for some audiences.
- bch 12y ago> To be fair, I am coming at this from the standpoint of someone who uses git for science, rather than software development As a software developer, I would rather spend my time on the task at hand (my own development) rather than git internals. I don't understand why so many people apologize for the (imo) poor user-experience that git provides...
- VLM 12y agoI would agree with and extend your remarks that stereotypically all git books begin with creating a nice clean repo and all git users begin by being thrown into the deep end with an existing project. Rather than writing the tutorial starting from nothing and creating a repo and entering its first commit, it might be very interesting to write a tutorial starting from a simple artificial repo with just a couple branches and commits. I believe this tendency comes from programming where "the book" usually starts with typing in hello world, but the real world usually starts with maint work on existing code. I still git-flow, I donno if thats cool or not. HN is extremely fad focused so its possible half the readership don't even know what git flow is/was because it was cool waaaaay back when nosql was going to save us all. It would be interesting if the tutorial reflected git flow or possible alternatives.
- jmount 12y agoOddly enough I think that is one of the reasons Git is popular: you are exposed early to a learnable mental model. (edit: it is a model of Git's storage interface, not a model of version control or a model of storage implementation)
- dalai 12y agoHonestly, since when is that a great feature? I can't think of any other piece of modern software that requires that of its users (other dvcs with similar feature sets included). Noone should care about "internal" interfaces, no matter if they are easy to learn or not.
- jmount 12y agoProgrammers are pretty used to building mental models. And my point was that at least you can learn the git internals, but other "everything magic happens but we don't let you even reason how" source control systems are even less learnable than Git.
- cglee 12y agoHere's a very beginner friendly guide on git and Github. It's for people who may have never used version control in the past: http://www.gotealeaf.com/books/git http://www.gotealeaf.com/books/git
- jbranchaud 12y agoThis is a really nice, extensive guide. However, I think when introducing Git and its internals for the first time, it is essential to use graphs/diagrams. This tutorial doesn't have any which is its biggest shortcoming. Regardless, I would still recommend this tutorial to friends.
- mrchlblng 12y agoAgree that diagrams would help clarify some points. I was a bit short on time for this so I thought that only using git outputs could be enough; I will try to spend some time to incorporate some illustrations!
- vitd 12y agoIf you do, I highly recommend avoiding the types of graphs that git draws for you and that some tools show. (The ones that show the branching history.) As a beginner, I found the graphs way more confusing than what was actually happening, as it didn't communicate anything I could understand. In fact, it made it look like something else was happening than what actually was.
- mrchlblng 12y agoInteresting. Do you think that confusion comes from the fact that commit history (to not say 'time') is represented vertically (and sometime going upward and sometime downward)?
- hardwaresofton 12y agoStill like this as an introduction to git: http://rogerdudler.github.io/git-guide/ http://rogerdudler.github.io/git-guide/ "no deep shit" The guide that OP posted is great, but once I see a wall of text in table of contents, I'm instantly turned off. Again, maybe most people will have a better attention span than I do, but some of them will not
- mrchlblng 12y agoAgree that it seems like a lot of text. Added this very good reference (however think it's not enough for students discovering the subject)
- hardwaresofton 12y agoagree, it's definitely not enough for anyone who wants to really understand git, but definitely enough to at least get people in the right ballpark of how things work, and maybe draw analogues to whatever system they came from (hg/SVN/whatever)
- kenjackson 12y agoThis is better than I thought it would be (I read the comments here first). I do agree that some of the content can be glossed over (move some of the internals discussion later in the document), and some figures might be useful -- but you must be careful. I've been fooled by figures more often than I'd like. Overall I feel like this is a good addition to the Git introduction space. One big piece of feedback is that would be useful to have a section on obtaining and setting Git up the first time. Especially for Windows users, it may not be obvious.
- mrchlblng 12y agoThanks for the feedback! Regarding the setup, that could be an addition. It probably need a clearer write up but I added the "Protocols" section to help people understand that SSH is not a must have; from what I've seen the Windows setup difficulties is mostly about SSH -- would you confirm that?
- kenjackson 12y agoI'm not sure about SSH. You might be correct. I've gotten my setup to work w/o SSH. Although I've mostly just been using the GitHub Windows client lately. :-\
- tuan_kuranes 12y agoFinally, a git introduction for real users ! Those that need to understand how it works rather than repeating commands copy/pasted from "command list" have to read it. Because soon enough, you'll end up in a specific situation needing a specific command...