
A practical Git introduction - mrchlblng
http://mrchlblng.me/2014/09/practical-git-introduction/
======
mattip
The 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
To 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.

~~~
bch
> To me, it is one of Git's strengths, that it's internal data structure is
> simple enough to describe and understand

I find it's _not_ simple enough to describe and understand, and that it almost
seems _necessary_ to know it, which takes up cognitive attention/space. I feel
like it's a failure of design (poor abstraction, or simply bad engineering)
that these sorts of introductions are rehashed over and over and over again. I
suspect Git is only popular because

1) Cult of Linus

2) Github

Otherwise, there are other capable more pleasant tools to use...

edit: formatting, s/Linux/Linus/

~~~
kbar13
Like with most things, popularity is not derived from what you expect, yet
popularity exists for good reason. Git may or may not be perfect, depending on
your point of view. However, it's more than sufficient to do the job, and it
does the job pretty darn well. The other factor is that it's popular
because.... it's popular.

Yes, it's a good idea to take on git because other people use it. It's not a
personal tool like your text editor where you can lord over your little realm
and customize the crap out of it. git is a collaboration tool.

~~~
bch
> Like with most things, popularity is not derived from what you expect

I listed what I suspect...

> yet popularity exists for good reason.

Are you talking about cause or effect ? Does it matter ?

> Git may or may not be perfect, depending on your point of view.

It's not, _nearly_ certainly regardless of ones PoV

> However, it's more than sufficient to do the job, and it does the job pretty
> darn well.

It's used a lot, and mostly works, sure.

> The other factor is that it's popular because.... it's popular.

What "other factor" is this? I was talking about what I consider weak points
and poor engineering -- I'm not denying it's popular... it's practically a
verb (people say "git" where "source control management", or "distributed
source control management" is what they mean...)

> Yes, it's a good idea to take on git because other people use it.

Network effect, I get it...

> It's not a personal tool like your text editor where you can lord over your
> little realm and customize the crap out of it.

Well... not everybody is managing the Linux kernel. Not everybody is even
collaborating. I use fossil[0] because I'd rather enjoy my development
process. It _works_ for me. I don't _care_ if Linus uses git, or if some high-
profile codebase is managed by git.

> git is a collaboration tool.

And so are fossil and mercurial. And I've run _many_ projects under fossil,
including ~20-person distributed (cross-country) projects that include
development, configuration, and release management. No git necessary.

I not saying git isn't popular, or can't do its job. I'm saying: Its a bit
hard to understand why git (which I suggest is unnecessarily difficult) is so
popular -- I listed my two suspicions.

[0] [http://fossil-scm.org](http://fossil-scm.org)

~~~
kaishiro
Just to add another anecdotal point on top of your own. I use git because it
gets the jobs done. I don't remotely care that Linus uses it. I've honestly
never ran into issues even on 20 person+ teams using simple branch & rebase
strategies. To each their own.

~~~
dalai
I am not sure what your point is. Subversion, git, hg, darcs all get the job
done. Was your choice of git based on its superiority over the other ones or
just a side effect of its popularity? The problem with git is not that you
will run into issues, it is that other vcs provide a saner ui and require less
of their users without missing on features.

~~~
kaishiro
But surely we all understand that the "best" tool doesn't always win the day,
right?

------
hardwaresofton
Still 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
Agree 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
agree, 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)

------
jbranchaud
This 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
Agree 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
If 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
Interesting. 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)?

------
josephjrobison
Maybe 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
Could 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
This 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.

------
kenjackson
This 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
Thanks 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
I'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
Finally, 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...

