Hacker News new | comments | show | ask | jobs | submit login
Got 15 minutes and want to learn Git? (github.com)
510 points by motowilliams 1903 days ago | hide | past | web | 171 comments | favorite



NOTE: This is not a rant, I'm just trying to give you a peek into my mind as I tried out this tutorial. I'm doing my best to describe my confusion.

I have no clue how to use Git, and I've been trying to wrap my head around it for a while. Unfortunately, this is yet another tutorial that is very frustrating even though it's designed to target noobs like myself.

So, I added octocat.txt to my staging area. Success! ... Wait. Why do I care? What did I do? Staging what, for what? Huh?

I committed some random text. Or something. And I typed "-m". So does "git commit -m 'something random'" actually do something? What did I commit to? Arrrggg. Why did I -m !?

Then there's this one: git commi­t -m 'Add all the octoc­at txt files­'

So it understands plain English? Was that the random text? Is that just some sample text as part of the Tutorial or does that actually work on Git? Oh man, I'm now more confused than when I started.

...

Anyway, for some reason, everyone who tries to describe Git already has such a strong understanding of it and it's oddities, that they are, for some reason, unable to lay it out properly for a noob IMO. I cannot figure out how anyone figures out Git, I assume there was some serious hand holding, because I'm just not grasping it and I usually "get" this stuff rather quickly. Maybe that's the problem, Git isn't something you can just pick up quickly, maybe I need to buy a huge Git how-to book like the old days.

Sincerely, Frustrated in Programming Land.


In a nutshell... a project can be described in terms of the changes a user makes over time.

In Git, these changes are called "commits".

Commits contain a change a user has made to the code and some additional useful metadata. This metadata includes the time the change was made, the user's name, a message to describe in general terms what the change was (that -m thing), and so on.

Git itself is a database that stores these commits. Each commit links back to the change before it, forming a chain.

If a single person is working on a project, this may be a linear chain of commits, but if multiple people are working on the same project, two people might make a change to the same text at the same time.

So maybe one person writes "The Nexus 7 costs £159", and another person writes "The Nexus 7 costs $199". If this happened, the chain would split; you'd have two valid changes made to the same text. The act of reconciling these chains is called a "merge". We might choose to use one version or the other, or to combine the two, such as "The Nexus 7 costs $199 (£159)".

That's basically it. The only other thing Git does is to allow you to give commits a human-readable name so you can refer back to them later.


Again, this is a gross oversimplification that describes only generic version control concepts and none of the powerful features that .

Go ahead and try explaining a rebase without trying to broach the concepts of time travel. How about why having a local copy of all commits/branches/etc related to the repository is helpful, or even at all possible, without relating it to a simpler client/server version control system.


Go ahead and try explaining a rebase without trying to broach the concepts of time travel.

A project can be described in terms of the changes users make over time, and that lets us undo any previous changes all the way back to the beginning of the project.

I don't think that explanation is overly technical or difficult to understand, and the generic features of version control which you dismiss are precisely those that make it most useful - the above paragraph in my opinion encapsulates most of what is useful about a VCS. To extend the above to cover a rebase:

A rebase is just merging other people's changes with yours, so that you end up with a merged version of the files, but with details that mean it looks slightly cleaner in histories - it's not even something many people will ever have to do. As to why having a local copy is useful, who cares, it's a detail of how the VC works?

This really is not rocket science - while git can at times be frustrating if you hit a particular problem which it doesn't consider important like expunging files from history, the basics are very very simple. You really only need 3 commands for day to day use:

  git pull (get other people's changes)
  git push (send your changes to others)
  git commit (commit a change to your local copy)
Actually for commit I just add all new non-ignored files (using an alias like this: "git add --all .;git commit -a -m") to save typing, otherwise I might have to use git add as well now and then, so I use commit "My message here". If the above commands are scary, there are various alternatives to VCS, but they're not as good - you can rename your files when you make a change, you can use something like Apple's Time Machine, etc. All of those work, but are not really as easy as VC when you're changing a lot of files.


The core concept of Git is simple. All its more complex features can be derived from the idea that Git is a database of commits (changes + metadata).

A rebase is the act of changing the parent, or base, of a commit. So instead of a change being made to version A, you make the same change to version B. No time travel metaphors need to be involved, and IMO only complicate a very simple concept.

The harder part is explaining why you'd want a rebase.


Anyway, for some reason, everyone who tries to describe Git already has such a strong understanding of it and it's oddities, that they are, for some reason, unable to lay it out properly for a noob IMO.

This is a common problem in teaching, technical writing, and other forms of technical instruction.

Even when a good teacher or writer sets out to deliver material to total beginners, it's very tricky to truly enter the beginner's mindset and cast away a lot of the mental abstractions built up over the years.

I think one way to improve this situation is to focus on results and casually use features and techniques along the way rather than focus on features and techniques and have contrived examples to show off them off. The fewer technical terms or domain specific language you can use up front, the better. (I should note I've been very guilty of the contrived example approach, but this is what it's all about.. experimenting and learning what really works for learners :-))


I think one way to improve this situation is to focus on results and casually use features and techniques along the way rather than focus on features and techniques and have contrived examples to show off them off.

Yes, exactly! You have to start with examples. Real problems and then suggest solutions. Too many teachers, I'd say the majority, start from the abstract explanation and only bring in the example in the end -if at all.


This isn't necessarily a problem. I can learn by immersion.

Good teaching shouldn't introduce too many concepts at one time, but giving incremental goals that require interacting with a few related concepts is ideal. Tediously spelling out all the details is good for a spec, but would hurt interest and motivation.


I sympathize. What is really necessary are not tutorials on how to use Git--it isn't that hard, after all, for most of us--but more of a description of actual workflow. Not HOW you issue Git commands; but how to use Git.

It would be interesting to read articles about how a single programmer uses Git, how a small programming team, how a distributed team uses Git. Similar articles about how a team producing art, or text (not programmers) use Git.

There's plenty of Git command tutorials already; let's hear about how you actually use Git.


I completely agree. If it helps, I wrote up some visual tutorials about version control in general that many have found helpful:

http://betterexplained.com/articles/intro-to-distributed-ver...

The idea is to build a mental model about what is possible vs. memorizing a bunch of specific commands. Once I wrapped my head around the concepts, the commands fell into place.


Looks good!

On my screen the text is light gray on white. Is that intentional?


Whoops! Thanks for the comment, the text should be a readable black on white (like this: https://skitch.com/kalidazad/er7an/intro-to-distributed-vers...).

Which browser were you using? (I just tried FF, Chrome, Safari) Thanks!



Thanks, really appreciate it!


Agreed. And not only for Git. For basically anything else in programming land you get to have either hands on quick guides or spec listing. There's serious shortage of good, moderately abstract, short overviews of what something actually does and how it does it.

Take Vim for instance. When I first got to it, I found only resources that are paraphrased with "this command does that. that command does that... nth command does that". Now, if only someone described buffers, tabs and windows to me (like in an article that was recently linked to here on HN), or told me that commands can be described as acronyms of verbs and nouns etc. I'd be much more proficient with Vim now.

For Node.js, I found some talks/presentations from its creator that really hit this spot.

I still haven't found anything like that for Git.


> For Node.js, I found some talks/presentations from its creator that really hit this spot.

Mind sharing the specific ones which worked for you?

> I still haven't found anything like that for Git.

I shared a nice conceptual tutorial about git in a reply in another comment of the same thread. Here it is, http://news.ycombinator.com/item?id=4200426


Sure. Sorry for not linking to any in the first place.

Here it is http://youtu.be/M-sc73Y-zQA. He got cocky later on, so I don't like very much his presentations of a later date. In this one, he's pretty nervous on occasions. It's cute. :)

I just glanced at the git tutorial provided - it seems it is up my alley. Will check it out later on.


Sometime back, I wrote about my initial Git workflow: http://veerasundar.com/blog/2011/06/git-tutorial-my-git-work...


Correction, what we need is both. Tutorials and a description of the workflow. The articles are all nice touches as-well. Knowing how my team could be more organized helps me want to try it out.

And just in-case I came across as an asshole, I liked your post and thought it was great :)


I figured out Git, and I'm not that clever, so don't worry!

The staging area (aka the index) is where you put things before they become a commit. You don't always want to commit all of your changes at once. The index is there so you can commit the changes you want instead of just committing all the changes every time.

`git commit` means "turn the contents of the index into a commit". A commit is a set of changes that logically go together denoting a version of the repository. A commit needs to have a message describing what the commit does. If you just type "git commit", it opens up an editor for you to type in your commit message. If you want to skip the editor, you can just pass in the -m flag, followed by your commit message in quotes.

Are you familiar with the shell? Are you comfortable with the concept of a linked list? If not, work on those--even if you don't use Git, it's part of being a better programmer. But if you do understand these things, you can fairly easily get a very deep understanding of Git.


That doesn't explain the fundamental part. Why is there a staging area in the first place?

Place yourself in the shoes of a subversion user, the workflow is very simple and intuitive given that:

  1. the repository is a (remote) place where my project is stored
  2. the local copy is where I modify my project
Then, a commit is just pushing your modifications to the repository where other people can go get them.

Now, with git you don't have a remote repository. Your local copy is itself a repository. Think about this for a second. Then...

If a commit doesn't push my changes to a remote repository, why do I care?

Well, if a commit allows me to have a local history of changes that I may not want to have in the remote repository, why do I need to stage my changes? Why don't I just commit them and be done with that? Isn't the files themselves a stagind area? Isn't this all redundant?

These are the problems a non-Git user faces. Why do I care about this complexity? In what whay does this make the process of making my changes accessible to others easier?

Answer: it doesn't.

Regular people are usually perfectly happy with their other VCS solutions. The ones that want them to see the light and start using Git for all its benefits must thing about what makes Git useful and explain that.

It doesn't matter that Git is important for large distributed projects. Most people aren't a part of large distributed projects.

No tutorial that I can remember does this. Not a single one.


I use Git for just my own projects, and it's just me. I barely use branches either, and I come from SVN.

I use TortoiseSVN, I'm not sure if you do. But when I want to commit in SVN, I bring up the commit tool, select the files I want to commit, write a message in the box, and click commit. But I have to do it all in one go. I can't close the commit window if I forget something, otherwise I have to make sure I copy out the message to paste in again, select all the files.

With Git, the staging area is the same as this commit box. It's just a bit more stretched out. Instead of selecting files to commit, and doing it then, you add files to the staging, and commit the staging area. It's a different way of doing it, but I've found it much better for myself. Instead of doing it all in one go, I can add to staging and keep working. Usually I keep open all the files that have changed so I remember which ones to add.

Regarding the remote repository, you still can have it remote. Simply instead of "commit" being the last action you do to push it to the remote repo, make sure "git push" is. I use bitbucket for this, so I know it's "safe" in case of computer death or something.

I have one more project using SVN and I want to move it to Git, for just me, I don't work in a team or anything like that. I like the staging area, it feels "lighter" and that commits are much less drastic, and diffs/logs are MUCH faster since it's all on your computer. Also, `git add -p` to craft your own commits.


There's a good reason that developers love git, it helps to organise code for _themselves_. Centralised VCSs are there to help you share your code with _other_ people.

Here's some problems I encounter everyday that git solves and SVN for instance doesn't.

1) I've been working on a feature since this morning but now there's a bug in production. I need to drop what I'm doing and come back to it when the bug is fixed.

2) I've implemented a feature but before I share it I want do some refactoring to clean it up. If I break something during the refactoring I want to be able to get back to the version that was working.

3) I'm working on integrating an old web API (SOAP hell) and I want to make a note of the workaround which is spread across several files. My tests aren't passing yet though so I don't want to share any code yet.

These are some examples of scenarios where git fits with _your_ workflow. This is where git really shines, not in the sharing of code (where it does also improve on SVN), but the ways in which it allows you to organise the pieces of code you're working on throughout your day.


> Why is there a staging area in the first place?

Because you don't always want to commit every change you've made or every new file you've added.

> If a commit doesn't push my changes to a remote repository, why do I care?

If I have my code in a working state, I'd like to save that "version" somewhere, so I can make a whole bunch of changes without worrying about whether or not I can get back to a working state. This is true even if no one else in the world has to read my code. This is the entire rationale of version control in the first place! But if I can do it just on my own individual changes, that means I can go back to a closer savepoint and not have to play the whole level over again if I screw up ;)

> Well, if a commit allows me to have a local history of changes that I may not want to have in the remote repository, why do I need to stage my changes? Why don't I just commit them and be done with that? Isn't the files themselves a stagind area? Isn't this all redundant?

No, because you still don't always want to commit every change you've made or every new file you've added!

Maybe you want to commit while you have Vim open but you don't want to add a bunch of garbage .swp files to your repo. Maybe you did two or three different things that aren't related, so you want them to show up as two or three different commits in the history.

From the perspective of a Subversion or Perforce user, it's not something you really think about because it's not even an option that you have. You effectively don't even have version control on your own machine. Your company has version control, but you don't. And in my personal experience as a Subversion or Perforce user, I frequently feel lost at sea in that environment because it's virtually impossible for me to reliably do things like:

1. Get back to a working state newer than the one I checked out of the repository after making lots of changes everywhere.

2. Make completely unrelated code changes at the same time without mixing the changes together. Maybe one change is blocking on a code review. Maybe I found an unrelated bug and want to fix it separately from whatever other changes I'm making. Maybe I'm second-guessing a certain feature addition and want to put it on ice while I do other things. Maybe someone reported a bug and I want to fix it separately from what I happen to be working on at the time. Whatever the reason, it can live in its own branch and I can come back to it later. I don't have to create duplicate workspaces in my file system, Git just manages it for me.

3. Turn a large, complicated code change into a series of smaller changes, each with its own diff and description which I can review more easily.

These are things I do every day. I would do them if I shared my code with a small team or with the entire world. I would do them if I shared my code with no one at all. Git isn't just for large distributed projects. It's for decoupling version control from version sharing or version verification.

In practice, the purpose of something like Subversion or Perforce isn't to help you as a programmer, it's to help the canonical owner of the code you're working on to do certain things, like rollback to past versions or make policies that your code has to pass code review or something before you can "check it in". Git handles all that too--some of it more effectively--and it has the added feature that even you the programmer can get the benefits of version control, too.

> No tutorial that I can remember does this. Not a single one.

The purpose of a tutorial is to help someone learn how to use Git. If you're not interested in learning how to use Git, why are you reading tutorials? It would be much easier to just start a flame war on Hacker News and wait for someone knowledgable to respond. I guess you figured that out yourself.


What disturbs me about that workflow is that your commits have literally never been tested because the staging area contents aren't accessible as a working copy. I for one am adamant about not littering my history with all my crap that didn't run, so I much prefer to commit the mixed work and then rewrite history to tease out and regress the independent changes. I pretty much always test and commit my workspace as-is, treating the staging area as an unfortunately visible implementation detail. It'd be easier if I could stash some but not all of my changes to get them out of my workspace temporarily, but this hasn't bugged me enough to figure out how to implement that.


> It'd be easier if I could stash some but not all of my changes to get them out of my workspace temporarily, but this hasn't bugged me enough to figure out how to implement that.

Here, let me help you, from the examples section of `git help stash`:

"Testing partial commits You can use git stash save --keep-index when you want to make two or more commits out of the changes in the work tree, and you want to test each change before committing:

               # ... hack hack hack ...
               $ git add --patch foo            # add just first part to the index
               $ git stash save --keep-index    # save all other changes to the stash
               $ edit/build/test first part
               $ git commit -m 'First part'     # commit fully tested change"
A nice thing about Git's Swiss army knife nature: someone else has likely run into most problems you encounter, and have added the solution to Git porcelain.


Thanks for the very genteel RTFM. I think you've pointed that out before, I just mischaracterized the process as quarantining the changes I don't want yet rather than rescuing the changes I do and forgot the mechanics.


> It'd be easier if I could stash some but not all of my changes to get them out of my workspace temporarily

It's literally called "git stash".

Aside from that, you can squash commits together after-the-fact. If it makes it any easier, you can squash a whole branch together all at once before pushing it out to other people. No one need be the wiser. The intermediate commits can just be temporary savepoints for your personal convenience.


The point isn't about me reading tutorials to learn Git.

The point is about convincing people to use Git by pointing them to tutorials and have them come back with blank stares and "why do I need this exactly?" questions.


Unfortunately you fell right into the trap he said everyone trying to explain Git does. The first paragraph is complete nonsense unless you already understand it.

You first call it a staging area and then you clarify with an "index," but you never clarify what an index is?! The second paragraph doesn't improve the situation much.

Ultimately I think there is a language breakdown here. People who explain Git seem to be unable to do so without using Git-language, and it is very difficult to understand the Git-language without understanding how it is used.

So therefore it is a chicken/egg problem. You somehow need to know the language to understand Git, but to understand the Git you need to understand the language.

PS - I know you're trying to help; it is just one of those things where I am not even sure it can be explained in that way.


I'm not saying it's an "index" to clarify what "staging area" means, I'm saying "index" is a synonym for "staging area" so if he runs into the word "index" somewhere, he knows it's just a different word for the same concept. For Christ's sake, there's nothing magic about the words, they're just names for something. If you didn't know what a dog was, and I said "a dog (aka a canine) is a domesticated animal related to a wolf", I'm not expecting the word "canine" to add anything to the explanation, I'm just throwing it in there in case you run into someone else who says "canine" instead of "dog", just so you know that in both cases they're referring to the same type of thing.

In any case, a staging area only makes sense in the context of trying to create a commit, and I think I did usefully define what a commit is. Maybe that part should have come first.


I suppose you have to know the general idea of a Version Control System (VCS) first before you can understand how Git does version control. I'll try my hand at it.

A Version Control System is a software system that uses files to save different versions of your source code (really, it can save any file, but it works best with source code). The system also lets you revert back to an old version of your code, so you can try something radical out on your code knowing that you have a safe version tucked away in your version control system.

A 'commit' is when you tell the VCS to take a "snapshot" of your files and then save that in its system. Git implements 'commits' with three-location system: the working index (the files on your computer), the staging index (Git's log of what files you want to change), and then the actual commit index (where all the versions are saved). When you stage a file, you tell Git to add the name of that file to it's internal log, telling Git that you want that file to be saved in a version. After you have told Git what files to save (by "staging" them), you can commit (with 'git commit') to save that snapshot of your staged files. Later on, you can revert to the snapshot through git commands.

Hope this helps!


See if the git parable helps:

Git is a simple, but extremely powerful system. Most people try to teach Git by demonstrating a few dozen commands and then yelling “tadaaaaa.” I believe this method is flawed. Such a treatment may leave you with the ability to use Git to perform simple tasks, but the Git commands will still feel like magical incantations. Doing anything out of the ordinary will be terrifying. Until you understand the concepts upon which Git is built, you’ll feel like a stranger in a foreign land.

The following parable will take you on a journey through the creation of a Git-like system from the ground up. Understanding the concepts presented here will be the most valuable thing you can do to prepare yourself to harness the full power of Git. The concepts themselves are quite simple, but allow for an amazing wealth of functionality to spring into existence. Read this parable all the way through and you should have very little trouble mastering the various Git commands and wielding the awesome power that Git makes available to you.

http://tom.preston-werner.com/2009/05/19/the-git-parable.htm...


I'm about half way through the Git Immersion tutorials [1], and so far it's been pretty good - clear explanations of what you're doing and why you should care.

[1] http://gitimmersion.com


+1 for this. Of all the tutorials I've tried, this was the one that sunk in the most.


The Pro Git book is relatively good. Ignore Chapter 1.

http://git-scm.com/book/en/Git-Basics


This is probably one of the easier tutorials out there.


Of all the basic version control intros/books, for me nothing beats Version Control by Example[1] book. It first explains the core concepts/commands behind version control such as create, commit, etc and them it goes on to illustrate how these commands actually implemented and used in practice using different version control systems.

The explanation is given for both centralized version control systems, using SVN, as well as for distributed version control systems, using Mercurial and Git (and Veracity).

Give it a try. The digital editions (PDF/EPUB/MOBI) are free for download I think.

[1] http://www.ericsink.com/vcbe/


Off-topic from the theme of your post, if you really want to learn about git, you could take the path that I did, which was to go by way of Mercurial (otherwise known as hg).

Hg is simpler than git in many ways. There's no "staging" for changes, so "commit" is just taking a snapshot of your files as they are right now. Simple.

And, since it's so simple, that means that you can write a really good tutorial for it, which Joel Spolsky did: http://hginit.com/01.html

Hg is plenty useful in its own right, and it doesn't really deserve to be training wheels for git as I've presented it here. But moving from hg to git is really easy; it makes git just seem like hg with a bunch more features.


Rather than these n00b tutorials, I recommend reading "Pro Git" by Scott Chacon, available for free here: http://git-scm.com/book

If you prefer a video, try "Getting Git" by Scott Chacon: http://vimeo.com/14629850

Coming from a Subversion & Perforce background, I was initially very confused by Git. There were two things that finally switched-on the old lightbulb for me:

a) Scott's book

b) Actively using Git for all of my personal projects (e.g. small school assignments and code experiments), without using a remote repository. If you defer learning about remote repositories for now, I'm sure the light will switch-on for you as well :)


b) glosses over what I've found to be one of the biggest brain-twisters in git - working with remotes.


Exactly: don't tackle remotes until you've learned the fundamentals of git, otherwise you'll be stuck with a big brain twister. If you start dealing with remotes right off the bat, like I initially did, you'll find git very frustrating and weird to work with. I kept treating git like it was svn, and just didn't get it. If you learn git without remotes first, the way git handles remotes will make way more sense to you once you finally explore that functionality.


> Maybe that's the problem, Git isn't something you can just pick up quickly

It is the problem, I think. Git isn't easy to use. It's a powerful tool designed by a very smart person (Linus) to manage a very complex project (the kernel). It's not a toy, and it's not designed for beginners. On top of that, the interface actually isn't that well designed, and is a pretty leaky abstraction layer that in many cases requires you to have some understanding of its internals [1]. But we're programmers, our work isn't always easy and the benefits of using Git or using any distributed version control system outweigh the alternatives (note that I'm not talking about Git vs Mercurial vs Darcs but rather about the previous generation of supposedly easier tools like SVN and CVS). So I really think it's worth struggling to master it and treat it like a first-class tool, that you're going to invest in because it's important, rather than try to find an easy way out.

I'm projecting on to you a little bit, and I apologize for that, but every time a Git tutorial hits the front page of HN, there are people expressing frustration or complaining that Git is too hard or too complex. Yeah, it's not perfect, but honestly, it's a damned good tool, and I think it's absolutely worth investing in. Most things worth learning are hard, and while that's not an excuse for poor tutorials (no comment on this one as I haven't tried it), I don't think programmers who take their profession seriously have much to excuse what seems like our almost constant desire for things to be easy.

Maybe the next generation of version control will be easier to use and have a more beautiful user interface, but Git is here now and there's an ecosystem around it supported by the network effects of its popularity, and I think that does end up outweighing the difficulty.

[1] That said, I think the inner core of its internals, ie representing revision history as a DAG of commits, is actually relatively simple, despite the poor interface. See this for what I think is one of the best intros to Git: http://ftp.newartisans.com/pub/git.from.bottom.up.pdf


Sounds like a false dilemma. Mercurial is here now, is powerful enough for a majority of users, is easy to use, and has an introductory book as well. After reading it and Spolsky's site, I picked it up in a few hours.

I think git is a good fit for people who find version control theory interesting, a endeavor in itself, or have complex workflows. For the rest of us, who simply need to work together (sometimes offline) with multiple synced backups, the complexity of git is too much.

Hg, for its flaws, keeps the simple things simple. I think the constant push from above to use git is a disservice, and I wonder if there will be a backlash at some point.


I specifically wasn't comparing Git to Mercurial, and noted so in my comment, mostly because I don't have any real experience with it. It certainly might be easier to use than Git, I don't actually know. I also don't know how many people who bemoan Git's complexity and learning curve have tried Mercurial, or even used any version control, and how many are migrating from SVN or CVS.


I use them both and I can say that Mercurial is way easier to learn and use than Git. Obviously, Mercurial has less features but, is there currently any DVCS system that has more features than Git?

The funny thing about Mercurial and Git is that they build on top of the same core concepts:

http://mercurial.selenic.com/wiki/GitConcepts


hg is leaps and bounds simpler than git. I came from a long svn background and picked up hg in about a day.

hg to git took several weeks, and I'm still learning.

I prefer git's handling of branches; hg never deletes a branch, just "closes" it, so you're left with a lot of mess if you do a great deal of branching. Other than that, I prefer hg.


the best way to learn Git is simply to be forced to use it. and even then you only learn subset you actually need to get the job done but at least it's something to get you started.

I'm not going to post link to yet another git tutorial. I would rather recommend to start with something like Heroku, Appharbor or similar.


I find by far the best way to learn git is actually walking through it with someone who knows, and asking absolutely every question that comes to your mind--force them to break it down. Email me at mrjordangoldstein@gmail.com if you want to set up a Skype chat/screenshare sometime, I'd love to teach you. It wasn't that much long ago I was in your shoes!

P.S. And the only way to get better with it after you learn is to use it everywhere. Which is a good idea anyway, because version control is incredibly useful.


I know how you feel. I was working on a very basic project and since i had some hand-holding i used git to publish the code to github, but now the hand-holding has stopped (my mentor doesnt have time to help me) and i'm no longer pushing to Github (dont want to make all my code open source).

It was too much of a learning curve to figure out how to deal with this change where Git was concerned, so i went back to mercurial which has a windows client and is easy enough to get my head round.

I do think that Git is probably more powerful as i see it in much more use in production out there, and at a guess i imagine that for version control it's probably more dependable and reliable than Mercurial - im not really qualified to say - but right now, i'm sticking to mercurial because at least i can wrap my head around it, and that's what matters, for now.


You're right. I'm halfway from git noob to power user. My problem with git is that everything is named badly. index, staging, head, ref, reset, rebase, pull, fetch, merge, all of it could have been named better. The commands could have better arguments. And you're right about most tutorials. They only make sense if you already know git.

These are pretty good. It's when I saw these that I realized everything in git is named poorly:

http://marklodato.github.com/visual-git-guide/index-en.html http://ndpsoftware.com/git-cheatsheet.html


> Anyway, for some reason, everyone who tries to describe Git already has such a strong understanding of it and it's oddities, that they are, for some reason, unable to lay it out properly for a noob IMO

I for one had a really hard time grasping Git, until I wiped my VC-mindset slate clean, it was primarily my upbringing in a development environment where Centralized Version Control was the king. I read up on Eric Sink's Version Control By Example. It's a great book to lay-out the fundamentals of Git. If you wrap yourself around the concept and not the tool, the use of tools (Git commandlines, Git GUI's) will come naturally.


I can empathize, been in a similar situation myself. Most of the git tutorials out there have a problem that they don't explain much of the 'why' and just tell about the 'how'. They are telling mostly about commands and not about the concepts behind it.

Some guy at Harvard wrote a great tutorial[1] on understanding git conceptually. It has been on of the best git tutorials I have read myself.

[1] Understand Git Conceptually - http://www.eecs.harvard.edu/~cduan/technical/git/


There is also "Think Like a Git" (http://think-like-a-git.net/), "The Git Cheatsheet" (http://ndpsoftware.com/git-cheatsheet.html) and "Git, the simple guide" (http://rogerdudler.github.com/git-guide/). This might just be piling on to your 'yet another tutorial' list but maybe one of these will help it click for you.


I liked http://gitref.org when I started with git. I find it's a good quick reference to common git commands so you can quickly get up and running with git. The rest of learning git is really just practice and searching for how to do stuff when you need to.

The section on commit explains what the '-m' option is:http://gitref.org/basic/#commit


It's pretty clear that this tutorial expects you to already have some experience with concepts in revision control. However, the problem is that if you're already experienced in revision control, you would probably find this tutorial a little simplistic and condescending.

Basically, git has a steep learning curve and people haven't found a good way to flatten it out a bit.


The svn book, (and I believe the hg) spends a number of chapters explaining how version control works. It will also give you some background on how things were, and where they're going. If the git docs don't do a good enough job, I suggest you read/skim the introductory chapters of these two free books.


This is the best intro I've read to get the concepts of distributed version control: http://hginit.com/

It's specific to Mercurial, but git is very similar. If it's the overall concepts that are giving you trouble, that should be effective in removing those blocks.


It sounds like the problem isn't git itself, but the concept of source control in general, which is pretty abstract until you actually dig into a source-controlled project that has other people committing - after that, the understanding comes pretty naturally.


The tutorial definitely glosses over some information that you would need to research later on.

For a more in-depth guide, check out the Pro Git book @ http://git-scm.com/book. You can read it online for free.


Yeah, it should certainly start with some intro explaining the idea of VC and defining words like commit or repo.


Perhaps what's missing in Git is a good metaphor.


Can we please stop pretending that Git is simple and easy to learn? If that were true then there wouldn't be "Learn how to use Git in <X> minutes!" posts every other day.

The fact of the matter is that Git is incredibly powerful but also complex and hard to learn. This isn't a bash on Git at all. It's ok! Sometimes complicated things are just that, complicated.

I believe we'll have better guides and tutorials if people stop treating Git like it's easier or more simple than it actually is.


I haven't read any books or longer tutorials on Git. I find it easy to use and if I run into trouble I just Google after help (which happens a few times a week). Throughout the day I mostly use 9 Git commands. Here are the top 9 commands I use:

    git checkout X
    git checkout -b new-branch
    git commit
    git add; git mv; git rm; 
    git pull --rebase
    git rebase origin/master
    git push origin X
I have used this for a long time without running into huge amounts of trouble (and if I need to revert back to a specific or do anything special I can always consult Google). The bottom line is: For simple cases Git is really simple to use and to learn. You don't need to become a Git master to use Git.

The problem is that people introduce the powerful features of Git that only a few percentage of people will ever use.


Everything you just said is exactly why Git is not simple and can not be learned in 15 minutes. Just by operating from the command line you've already left the realm of "simple" in my opinion. Having to learn 9 commands is not simple. Having to hit Google for help multiple times per week is not simple.

I strongly, strongly disagree with your assertion that "for simple cases Git is really simple to use and to learn". I've watched many programmers, artists, and designers who have used source control struggle with Git from day 1. I'm sorry, it's just not simple and if it were this topic wouldn't come up over and over and over.

Again, I say none of this as a slight to Git. Complicated things are complicated. That's ok, but pretending they aren't isn't helpful.


> Just by operating from the command line you've already left the realm of "simple" in my opinion.

Git is a tool for programmers. There's no excuse for a programmer to be uncomfortable with the command line.


The problem (for me, anyway) isn't that git basically requires a command line to do anything - the problem is that git's command line syntax is exceptionally complex. I'm used to being able to do `man foo' and get a short listing of all possible orderings of parameters and arguments that a tool will accept. git's syntax is so powerful that it isn't possible to do this - a lot of the summaries in the manpages have the dreaded one-line `command [ARGS] ... [PARAMETERS] ...' that I tend to associate with a lot of the GNU tools.

Maybe if someone added an EBNF grammar to the documentation...


I am a productive programmer and I am absolute uncomfortable with the command line. I can't count the times I have written

    svn commit -m "Finally fixed bug #123!"
...only to get some weird bizarro error because I should have used '' or escaped the !. This is usually when I am deeply focused on some programming language or bug #123.

Tower.app is the only reason I've ever touched git, and the line-by-line staging and committing is nothing I would ever bother to do with a CLI.


Well, suit yourself. It's just a tremendously useful skill to have. Makes it a bit less of a hassle to ssh into the odd server to check the logs, or dump a database, or use tools that don't have a GUI.

I mean, fundamentally, you're typing things to a computer and then the computer does what you typed. Why should that notion be uncomfortable to a programmer of all people?


Oh, I can use the terminal, I can also theoretically write PHP, and every vim user can theoretically use Eclipse. But that doesn't mean that any of us would be comfortable with it - we'd all be anxious and focused on the tool (instead of the problem at hand) not to break stuff left and right.


What kind of argument is that? How can you ever learn anything new with this attitude? If you never leave your comfort zone you will never make any progress. Just do it.


I have listed things that I have tried out for months. I happen to really hate these particular three. Now I study other things that I find more worthy of human lifetime, some of them just as useful to a programmer.

Why can you not accept that someone could possibly hate working with a shell or git's CLI even after trying them out? I don't get it.


I think this is a general problem with people with extreme addiction to IDEs and Windows based UIs.

I've known people in my team who can't do any work on the command line comfortably. I see this problem especially among people who work on Frontend and especially Java developers.

If a certain set of tools are making you dumber by the day, know it for sure that it will be automated or you will be replaced by lesser skilled cheap labor inevitably.


> If a certain set of tools are making you dumber by the day

How does "not comfortable with the command line" translate to "dumber by the day?" If people get their training using IDEs and go on to be productive using primarily IDEs, how does being uncomfortable with the command line reflect on their intelligence in any way?

> know it for sure that it will be automated or you will be replaced by lesser skilled cheap labor inevitably.

Yes, the mundane, confusing use of the git command line is here to stay and the dumb "actually design and engineer an application" world of IDEs is going to be replaced by robots. You are a fucking genius. Only on the internet can such backwards and completely worthless logic be said because if you tried to say this shit to anyone in real life you'd be laughed out of the room.


How does "not comfortable with the command line" translate to "dumber by the day?" If people get their training using IDEs and go on to be productive using primarily IDEs, how does being uncomfortable with the command line reflect on their intelligence in any way?

I agree with you completely. Being familiar with the idiosyncrasies of the console does not make you smarter than people who aren't; you've just learnt different things.

You are a fucking genius. Only on the internet can such backwards and completely worthless logic be said because if you tried to say this shit to anyone in real life you'd be laughed out of the room.

You went off the rails here. You can disagree without being abusive. Downvoted, sorry.


You are taking it personally.

>>How does "not comfortable with the command line" translate to "dumber by the day?" If people get their training using IDEs and go on to be productive using primarily IDEs, how does being uncomfortable with the command line reflect on their intelligence in any way?

Because the common characteristics of such people is to heavily depend on intellisense and auto complete to do almost any task. Tool generated code is so common in those communities most code is generally taken care by the IDE. Import statements, exception handling, try/catch blocks, loop generation in context of previous statements. The list endless...

When you are tuned to thinking this way you basically lose any touch on proactive coding. You stop thinking, the IDE starts thinking for you. You stop reading API because you know everything is about to be auto completed, anyway. Now the issue is you are offloading the job of thinking to the IDE. This is dangerous.

If a rookie can do what an expert can, just by using an IDE. I guess its time for the expert to fear for his job.

Lack of knowledge of command line utils is just one such case. You can either learn how to use awk/sed/Perl + Text processing utils. Or you can open up eclipse and endlessly re implement what the command line has to already offer.

When you start looking this from the larger perspective, refusing to learn tools designed to solve a problem in the proper way and taking short cuts, actually makes your life difficult on the longer run.

>>Yes, the mundane, confusing use of the git command line is here to stay and the dumb "actually design and engineer an application" world of IDEs is going to be replaced by robots. You are a fucking genius. Only on the internet can such backwards and completely worthless logic be said because if you tried to say this shit to anyone in real life you'd be laughed out of the room.

Definition of dumb varies. Definition of 'usability' varies. By your definition a programming language could be called dumb, a microprocessor and its interfaces can be called dumb, A pilots cabin and controls can be called dumb(As they are both not easy to laymen, and have never even made progress in that direction). A tool like git is not designed to be a toy or recreation software. Its supposed to manage text/binary versions in situations faced by individuals, small and large teams managing software projects.

Therefore it is designed to cover features in that direction, for programmers. Not for your ordinary user who needs to use the ATM to withdraw money.

Complaining about command line's usability being difficult is same as complaining about an Airplane's cockpit.


>>Because the common characteristics of such people is to heavily depend on intellisense and auto complete to do almost any task. Tool generated code is so common in those communities most code is generally taken care by the IDE. Import statements, exception handling, try/catch blocks, loop generation in context of previous statements. The list endless...

Because that code can be easily automated... choosing not to is just wasting your time.

>>When you are tuned to thinking this way you basically lose any touch on proactive coding. You stop thinking, the IDE starts thinking for you. You stop reading API because you know everything is about to be auto completed, anyway. Now the issue is you are offloading the job of thinking to the IDE. This is dangerous.

False. You stop thinking about boilerplate code and API details and free yourself to focus on the actual problem at hand.

>>If a rookie can do what an expert can, just by using an IDE. I guess its time for the expert to fear for his job.

Do you consider writing good code an issue of speed typing? I have no idea why you believe an IDE would be able to make a beginner into an expert.

>>Lack of knowledge of command line utils is just one such case. You can either learn how to use awk/sed/Perl + Text processing utils. Or you can open up eclipse and endlessly re implement what the command line has to already offer.

Or you could use your IDE to write something that the command line doesn't do. Nice strawman.

I can never understand why people who are in the business of automating tasks (programmers) hate tools that automate tasks (IDE's), of all things.


If I want to automate my programming, I use a higher level language where the boilerplate isn't required.


So the examples given where these:

>> Import statements, exception handling, try/catch blocks, loop generation

What "high-level language" are you using where this stuff isn't necessary?


Ruby on Rails. It's not even that high-level, but:

1. The number of import statements in the typical code file in the typical Rails app is anywhere between 0 and 3, heavily weighted towards 0. Turns out you can metaprogram class-loading behavior in high-level languages and it just seems to work.

2. It's rare to find good places where exception handling is the best way to go in Rails, except for debugging purposes, in which case the default Rails behavior--to render the exception in a 500 if you're running in developer mode--is usually what I want.

3. Aren't try/catch blocks exception handling?

4. `.each do |e|`; `.map do |e|`. I can handle those on my own.

OK, there's serious shit you can't write in Ruby, but languages like Scala and Clojure are equally high-level, probably even more high-level, and yet have better performance and JVM integration.

Still, I understand there are legitimate reasons you'd use a language like Java, and given a language like Java, I can understand that you'd want an IDE to automate the drudgery. But I still don't like IDE's, because they're an ugly solution to a problem that doesn't need to exist. If I can concisely express what I want to do in my code to Eclipse, I should fundamentally be able to express the same idea just as concisely in the code itself.


I'm mostly ignorant of Ruby, so maybe you can help me out.

1. And how exactly do they get away with that? What if you wanted to use a class that had a name conflict with a Ruby library class? Import/require are useful for namespace resolution. It seems that not having them would just be limiting your ability to name things cleanly.

2. Well sure, exception handling shouldn't be the rule, but how often you use them isn't usually a language concern (except maybe with Java and checked exceptions). Nonetheless, when you do use them, having your IDE give you shortcuts to write the boilerplate code is a plus.


> What if you wanted to use a class that had a name conflict with a Ruby library class?

I just try to avoid going around calling my classes things like "Fixnum" or "Array".

Seriously though, this kind of thing is all set up at the framework level, though you do sometimes have explicit requires for external libraries (gems) that you bring in. The Ruby standard library isn't that big, and Rails' libraries are named and namespaced intelligently and pretty much sit in the background without having to be explicitly invoked too much.

It helps that the main source of Ruby libraries is RubyGems, most RubyGems have a class or namespace named after the name of the gem, and there's a canonical source of RubyGems that doesn't allow you to use the name of gems that already exist.

> Well sure, exception handling shouldn't be the rule, but how often you use them isn't usually a language concern (except maybe with Java and checked exceptions). Nonetheless, when you do use them, having your IDE give you shortcuts to write the boilerplate code is a plus.

I guess Ruby exception handling just doesn't have much boilerplate code.


> Complaining about command line's usability being difficult is same as complaining about an Airplane's cockpit.

The cockpit is an interface (a GUI even) tailored for flying. The command line is an interface tailored mainly for administration and automation with a focus on text and files. A broom is tailored for cleaning the office and I use it when I have to. But what does this all have to do with what a programmer generally should be able to do?

I know the stereotype of the dumb Java/Eclipse programmer that apparently upsets you, and they certainly don't embrace the command line. But please, that does not imply that hating the command line turns one into a worse programmer.

> You are taking it personally.

(Not me, but:) You jump from not being comfortable with the command to getting dumber by the day, then eventually being obsolete. It's not really hard to read some elitism into that. Same for:

> A tool like git is not designed to be a toy or recreation software.

> Therefore it is designed to cover features in that direction, for programmers. Not for your ordinary user ...


"Everything you just said is exactly why Git is not simple and can not be learned in 15 minutes. " haha agreed

"Just by operating from the command line you've already left the realm of "simple" in my opinion." It's all about the audience, people who are used to CLIs will find new CLIs that are similar to the ones they already know simple.

"I strongly, strongly disagree with your assertion that "for simple cases Git is really simple to use and to learn"

I've taught git to designers in 15 minutes and had them off and running for the next ~6 months. That said even after a few months of using it I still lack understanding of some of the core concepts.


Sorry, But how is that difficult.

Even the simplest form of source control involves checkout->change/add->commit->checkin. And this is regardless of any version control system you will ever use.

The only extra stuff there is branching and merging. And to be frank. I've never felt the individual need to do that. Its a different story if you have a big team and members working on several projects which merge at a time. Now that's difficult with any VCS, not just git.

But for individual development anybody should be able to do the checkout->add/change->commit>checkin easily.


Reading through the comments here is infuriating, and it's no wonder people don't git what the big deal is.</lame>

With git you can share you current work to any arbitrary remote branch. The implications are your half baked feature can get pushed up and your coworker can do a checkout on the new remote branch. If they have suggestions they can make a change which you can cherry-pick off their branch into your branch. Also, you can branch off your current working branch, rebase master and merge their new branch in and push that up to master when everything works as expected. Try that workflow without breaking the central repo effecting everyone else's work in SVN.


Learning everything about git is hard, but learning enough git to use personally isn't that hard.

I use git personally to keep backups of my code and deploy sites I work on. I dont' work with other developers so my knowledge of git is workable, but probably super small.

Git gets complicated (but probably extremely useful) when working with bigger groups and tons of commits, branches and merges.


I feel like there's not much point in any sort of VCS lesson if it doesn't go over the more complex areas though. For example, reverting commits and resetting to earlier points in history are pretty essential actions, but both have their subtleties in Git (e.g why reverting a merge is hard, what 'reset' vs 'checkout' do) that will bite you if you don't know what you're doing. And everyone's fucked up via git rebase at least once.

If you never need to merge, revert, or in general use any of the aspects of Git that make it special then it's totally reasonable to use something simpler like built-in OS versioning or a conceptually simpler VCS like SVN. But I guess there's no reason why Github would sponsor that, right?


Sorry, maybe I've just been using Git for long enough not to remember the pain, but can you explain "why reverting a merge is hard"?

Yeah, the Git command `revert` has a bunch of kind of esoteric flags, but once you understand that it can stomp on your working dir and/or your index, it's not that hard to use. I don't know what about reverting to a point prior to a merge would be difficult, unless you are in the middle of a merge at the time. Again, sounds like most trouble is caused by not understanding how to use what is a relatively powerful piece of software.

No one is stopping you from using the built-in OS versioning, SVN or Dropbox. IMO that would be a nightmare for anything beyond the most simple cases.


Reverting a merge with git revert is not hard but it is dangerous since if you want to merge the same branch later it will not merge the commit in the merged branch at the time of the reverted merge. You have to remember to revert the revert before attempting to merge again.


I disagree, I use the very basics of Git for my very small one man projects and was very happy about it! But it just so happened that some have grown to two or three man projects that benefited greatly of actually having a distributed system already setup, this wouldn't have happened if I would have been using the wrong tools! Git is quite easy to use a at a basic level and you know it will scale just as much as you probably need, I have no idea which of my projects will grow and how big, but I do know that using the right tools from the very beginning will not come back to bite me later!


Pro Git does a really good job of explaining everything you need to know about git without trying to do it really quickly.

After reading it, I have a much better understand of git, and can work myself (and others) out of pretty much any oh-my-god-I-destroyed-everything problem I run across. You haven't broken stuff for real until you need to use git reflog.

Link to book, free to read online: http://git-scm.com/book/


I'm with you. Git is powerful but in terms of user interface it's a complete train wreck. It doesn't need more guides or tutorials as much as it needs a sane command line and help messages. There's space for a Git fork, or a higher level "porcelain", as Linus himself calls it.


I used to be like you. I didn't understand git and had no real reason to - I was used to using things like TFS and Vault just fine at work. Then a friend of mine got a job with Github and I suddenly had a reason to care about git. Once I had a reason to learn I found it much easier to understand and use, and now I've even started using tfs-git at work for fun.

So if you find git is hard or confusing just become friends with someone at github. ;)


There are a lot of cases even on bigger SW projects when for some roles(designers, tech writers) just basic git skills would save a lot of nerves to developers.

Designers can fix small things, like images, tweak html a bit etc. They dont need to know how to create/merge new branches etc..

I dont see that Git is trying to pretend that its simple but i can see how that interactive tutorial can be incredible useful to a lot of people.


its great that Git wants to explain what it got to offer to me, but why on step #7 it is mandatory to create a new account??

this killed entire positive experience, in my view.


Github wants to explain what Git has to offer you. I assume they want to see you as a potential customer, and if nothing else it gives you a real live low-risk git repository to play with after you're done with the tutorial.


Complex is not the same as complicated. Git is complex, but not complicated.


Git makes me think of Go (the board game), Rule 30 and Rule 110 cellular automata and Conway's Game of Life: a few simple defining rules that can be explain in a minute, but incredibly rich behavior follows.


Git is a very simple and powerful system covered by a hideous and complicated CLI. The simplicity is simply hidden.


Your comment reminded me of http://news.ycombinator.com/item?id=4201044 (I posted it after reading your comment), that impishly hints at what you say.


It would be nice to get everything on one page. As it is, in my laptop I am scrolling up and down a lot to see the instructions, the terminal, and the local filesystem, which are laid out as three rows in one long column.

I did the tutorial mostly without looking at the filesystem so I could stop scrolling. But I know I missed a few helpful "extra" hints because they were below the fold next to the filesystem.

On the plus side, it piqued my interest. I've been meaning to get around to this.


As someone new to git, I was dissapointed to see that:

    git add "*.txt"
added all of the .txt files from the current directory AND all of the .txt files contained within a subdirectory. I would have expected the same files to get added as those that would have shown up using:

    ls *.txt
For other new users: I've been told that this is an error in the tutorial. The tutorial forced the use of quotes but apparently they are not required and git would have added only the files that show up with the ls command as indicated above.

EDIT: I'm wrong. Using quotation marks DOES make git fetch .txt files within subdirectories. As pointed out by cellularmitosis, git seems to do it's own "interesting" glob expansion.


Nice Find! I added it to my git-themed twitter account here: https://twitter.com/#!/gitHater

Let me explain what's happening.

What you are looking at is actually part-git, part unix-shell-y.

You did ls * .txt

Let's try something way crazy, type echo * .txt

What do you see? All of your txt files right? But that's just echo, not ls.

Ahh. Here's the clinch. When you do " * ", that's called either shell "expansion" or "globbing" depending on your shell. Basically, the shell says "ok, before I run your command, I'm going to look at it and see if I need to do anything on my end"

This is why you can do

   $ n=0
   $ echo $n
The shell hijacks your input, replacing "$n" with "0", then feeds it into echo

In your example, the shell has hijacked the star in "ls * .txt", replaced it with all of your txt files, say (a.txt, b.txt) and then ran ls.

That means that ls ACTUALLY got

   ls a.txt b.txt
And THAT's why it works with echo.

---------

So git add "* .txt" works differently, what gives?

Well, when you put things in double or single quotes you are telling the shell "hey, don't do your usual stuff here". The single quotes are more extreme. If we go back to our n=0 example we can try two more things:

   $ n=0
   $ echo $n
   $ echo "$n"
   $ echo '$n'
As you can see, the ' says "relax shell, I have this".

So when you do

    git add "* .txt" 
you are actually passing the "* .txt" to git.

In most reasonable, sensible programs, the program will look for a file named "asterisk dot t x t" in this case.

But alas, our friends at git have decided to be tricky. The ' * ' syntax for git is similar to gitignore-like syntax (http://www.kernel.org/pub/software/scm/git/docs/v1.7.10/giti...)

"Awesome", you exclaim! Not so fast. It's not the same.

So git add '!1' doesn't work. git add 'one/ * * ' doesn't work, only git add ' * ' seems to work.

Why is it so hard? Good question! I haven't any idea. But we can commiserate together ... you know, over twitter.

Have a good one!


It had you use `git add '* .txt'` because there were untracked txt files in the octofamily directory. `git add * .txt` would have just added the txt files in the root of the directory and ignored the octofamily directory.

I wouldn't think this is so much an error as they _want_ you to use '*.txt' to add the files in the subdirectory along with the files in the root. They could have touched better on the difference between quotes and no quotes though.


for those who aren't familiar with the nitty gritty, what's happening here is that bash (your shell) expands the "glob" (* .txt) before it ever runs ls, so what actually gets run isn't 'ls * .txt', it's 'ls foo.txt bar.txt dog.txt' etc.

but when you put quotes around "* .txt", that tells bash not to expand the glob.

so in the above case, '* .txt' is actually getting passed into git, rather than 'foo.txt bar.txt dog.txt' etc. I'm not a git user, but it sounds like git has special handling for "* .txt" which causes it to perform its own glob expansion, which happens to also include descending into directories. hilarity ensues.

EDIT: I can't seem to figure out how to type * .txt without triggering the italicized formatter, so I had to put a space after the asterisk. urgh.


I tried varying my commit messages from those recommended, (e.g., in the second commit, I typed 'git commit -m "Commit all the things!"'), and the commit messages weren't reflected in the "git log" output. It's not clear to me now how much of this is canned response and how much actually runs git.


This tutorial is very pretty and does a great job of emulating the local Git experience using just a single interactive webpage. However, Github seems to be trying to introduce Git to a wider audience - namely non-developers.

From the blog post[1]:

"If you know of a developer, designer, or other knowledge worker that would benefit from using Git but that hasn't made the leap just yet, send them over to try.github.com when they have a spare 15 minutes."

As a developer, it would be nice to know how well this tutorial really works for non-developers. To me, it seems that the tutorial introduces way too many concepts and details in a very short time for a non-developer to understand.

For example, there are a lot of people that work daily with a computer but freeze completely when faced with the task of using a command-line interface. Yes, clicking on the command does write it in the console but you still have to know to press the return key to actually execute the command.

I'm not saying people shouldn't learn Git, I'm just wondering what the target audience and purpose of this tutorial is.

[1] https://github.com/blog/1183-try-git-in-your-browser


It's hard to know how well it works for non-developers until we've had hundreds of non-developers going through the course. Which should hopefully be happening now.

I can't speak for GitHub (I'm from the Code School team that built this), but we were very cautious not to introduce too many concepts in that course (you can see below someone saying it's too basic, yes, that's the point), simply the absolute basics we thought people would need to know to understand Git. We also did our best to not introduce Unix concepts, which open another can of worms.

The point is that a very large amount of people working on and around the web today are terrified of the command line. There are plenty of tools that attempt to abstract away the Git command line interface, and our goal with Try Git was not to do that. To give people the real Git experience and try to ease them into it.

I'm sure we can improve it over time to ensure that fewer people "freeze" in front of a command line. You're right that we may need to be more explicit as to what people should do after entering a command, but we need to stay as consistent as possible with the actual command line.

Please feel free to give more feedback, I'll be going through everything that's posted here.

— Olivier Lacan


Hi Olivier, great to know you're actively improving the tutorial!

Now that I checked the tutorial again, there seems to be a "Press enter to submit commands" help text before the command prompt. If you just added that, great, since that would have been my first suggestion anyway :)

As a developer using Git daily I can only guess what the most problematic parts of this tutorial are for beginners. I hope you get a lot of good feedback and data from all the people visiting the site!


Many great points Jyri. This course certainly is not meant to be a completely detailed introduction. At Code School we're in the middle of working on something that should be more of a step by step introduction.

However, I think there's something to be said for showing people how they can be immediately productive with a tool before really understanding everything that's going on underneath. With just a few commands someone can start using git successfully, and that's all we were trying to communicate with this tutorial.


Coming from someone who has very little command line experience, my experience with Git thus far has mainly been trial and error. Reading 10 Getting Started With Git blog posts is great, but there's always a part of me that knows some of the information I'm getting could be wrong or outdated. For me, this was a fast confirmation that the commands I've been using are correct and the workflow I've developed is 'valid'.


I have fairly extensive experience working with designers, and git is simply too complicated. The additional features offer them very little value, and the value they do offer is far outweighed by the complexity of the system and the propensity for difficult to resolve failure.


I rather agree. It seems difficult enough to teach people Alien Brain, SVN and Perforce, and they all have a much simpler model.

And is git much use to people who mainly work with large binary files? Well, I'm not sure (translation: "no") - but perhaps if they don't expect very much from their source control system, they won't be disappointed when git fails to deliver on its promises as well as it does for text.


I really appreciate the new learning tools to become more adept at programming and the command line. However, I often find myself mindlessly re-typing the commands being thrown at me without really understanding what's going on, or why I'm being asked to do it.

I liked the approach of Ruby Monks where they give you a task and let you guess the syntax. If you got stuck you then look at the solution.

I don't mean to make less of try git, or any other interactive tutorial. We live in a wonderful time where we are able to learn powerful tools without even installing them, so I almost feel bad about making this criticism. But I think current tools could be improved by removing some of the wizardy feeling and allowing users to play around and trying to figure out stuff on their own.


This is a great point. But before you can make people work at understanding something, you have to make them realize that they have a stake in trying to learn.

I don't think everyone (and certainly not myself) was able to understand the value of Git at first glance and decide to invest time and effort into learning about its inner workings.

Normal Code School courses and Ruby Monk challenges are made for people who already have somewhat of a vested interested in learning. Something that pushes them to challenge themselves beyond a simple demo/interactive tutorial. People like that are (sadly) a limited subset, we're trying to broaden that.


Something that often gets glossed over in explaining version control to a non-developer is, "WTF is happening with my files?"

The concept of a single folder containing multiple versions of your stuff is a big deal; the fact that you can't simply navigate to a branch as if it's a different folder--that you can't "see" all your files at once--is a non-trivial thing to punch through.


This doesn't help you learn Git. It helps you learn the commands for Git if you're already familiar with version control.

I can kind of sort of use Git already but frankly I don't understand what half of the commands do nor do I understand the point of them.

Technically the only commands I would assume you need are:

- Get repository - Merge repository (with comment) - Get history/comments

But Git has dozens of different things it can do that expand on the above and learning it all is time consuming and there is no one single place to do so (and no the documentation isn't a good place because it isn't a intuitive way to learn).

The biggest hurdle of using Git is that Git has its own vocabulary for things; and there is nothing "common sense" about that vocabulary. Even people who attempt to explain it assume you know another version control so use vocabulary from that.


Does this straight up just not work for anyone? I am typing in commands and am getting no feedback. Just getting a new $ line.


Link to their support forum's topic on this:

http://help.codeschool.com/discussions/code-school/3731-try-...


I'm having the same problem. Other people are complaining about this in their support forums.

Doesn't speak too highly of Code School in general.


@tdonaghe - we have fixed all the lag issues (in less than 15m no less). So not sure 20 minutes of sub-optimal experience justifies your comment. Hope you stick around to learn more! :)


I take back my complaint. :)

I just finished the course.

Great job guys!


Nop working here either. OSX Lion, Safari + no plugins + no java + adblock just in case.


Yup, its completely dead...


Runs a bit slow, but impressive nonetheless. I appreciate the simple but effective interface.

I love when sites do something like this in order to give potential users a quick taste of a language or technology. I already learned Git using the Pro Git book, but this would have come in handy as an introductory lesson.

This also reminds me the of the awesome tryruby.org


As someone who has never used git I found this tutorial relatively acceptable. I was disappointed there was not a level 2!


As someone without a trained programming background and never once used any version control (last time I programmed was for the ti-83 in middle school), Git at first was tough to pick up.

It wasn't until I went through Michael Hartl's Rails tutorial that I actually learned Github, master/branches, etc., and understood what are commits and pushes.


A lot of these Git tutorials seem to walk you through a series of commands as if knowing the commands is knowing Git.

I think they should focus on scenarios instead. Short stories like: "Bob's code is working well but he wants to try something that might be completely misguided. He knows better than to mess with his working code....." Then at the end of the story a command is introduced. Also, some kind of indication of what Git is actually doing when you issue that command. When you tell Git to branch, what actually happens to the file system? When you say git status, what is it actually looking at?

And please, don't start a tutorial on Git without introducing the three area paradigm (working, staging/index, commit)

Here's a talk by Scott Chacon of GitHub. http://www.youtube.com/watch?v=ZDR433b0HJY

It's over an hour long and very detailed.


Git _isn't_ easy to learn. Not at all. You can't spend 15 minutes looking at a Git tutorial or playing a game which teaches you Git, close the page and exclaim "Excellent! I know Git now!" - you can however put it on your CV, and blag it in that new job you're applying for where you need to understand git.

Like most things in software development, learning by doing is the best option because most people don't have photographic memories, and having a reference is usually essential.

Luckily, we all have one huge reference available to us, for free (more or less), with a thriving community who are more than happy to help: The Internet.

This tool is, nonetheless, a good starting point.


Very slick, but also very slow. Occasionally I have to run a command twice for it to register. Also, it's strange that git's output isn't colorized, considering the "Success!" messages are.


All the commands are implemented on the remote end (hence the latency), and some of them look like they are a limited node.js reimplementation (git is mostly the real deal, though the command list is whitelisted). I would be interested in a version that runs locally in JS/Linux.


Totally agree


My use of Git is basically to have a dev branch where I commit randomly, like some sort of ftp/backup, and a master branch that I merge from dev if I have a release ready.

The other day I tried to merge only some files from a new "experimental" branch and failed hard. I then realized I had it all wrong about how to successfully commit and manage branches.

And felt so lame :) The sad part is that I am the only one trying to use a CVS at work.

TL;DR : I still need to learn Git, so thank you everyone trying to "teach" it.


This is basically a glorified animation. On the commit stages, try adding a different message than theirs. When you get to the log stage, it shows their messages. :-(


Nice idea but far too basic. I need a Masterclass Git page.


I guess it was intended to be basic. The idea behind it is that you take 15 minutes and do some basic things and if you like it then you can then learn more about it... I think it's a great starting point. It gives noobs like me a good interactive, hands-on start.


I think this kind of stuff always has focus on basic usage. Git has inumerous features and inumerous ways to do some of then. It's so much to put in this format. If you like it and need some more go and read http://git-scm.com/book ... I've learned a lot in this online book.


I'd love that too… I wonder what the demand is for something like that.

I did some programming training a while back and found that there seemed to be way more people interested in the basics. I'd be curious if something like Git would be different.


@Beltiras - stay tuned to Code School in July, we might have something along those lines coming. ;)


there are some more advanced stuff here, still not expert though : https://github.com/Gazler/githug

would be cool to actually run githug under that website :)


Define expert, I'll see what I can do!


It looks like if you sign up there will be more classes?


When I went back to check I got this funky dialog that wanted permissions I was not comfortable granting. Too bad.


I really love the idea of sponsored courses/tutorials. This type of thing makes me more likely to use Git and GitHub more, and evangelize more.

I have a tough time wanting to pay for a course at a place like code school when I know if I go through the docs/tutorials I'll get it. It's not that I don't think the experience is better, or even (for a certain definition) worth the money. I feel like it is an unnecessary indulgence.


This is beginner-level content, which makes a lot of sense as a free resource. We're working on a Code School "Git Real" course for the end of July that will go much further than this and be at an intermediate level, just like most of the courses we offer through a subscription or individual purchase.

I suggest you check out the first level of that course when it comes out. I doubt you'll think it's an unnecessary indulgence. In the meantime our Node course is good example: http://node.codeschool.com


I seem to have great problems with this tutorial. And not that it actually does not help me with why and how I should use it in different scenarios (wich it doesn't), but my entire computer crashed for the first time. Got a major error, lots of blinking on the screen and the had to reboot several times. When I tried open it again, chrome crashed every single time. Not impressed.


Nice, but I think it's far too few. Stuff that this tutorial could be handled with tar as well. I'm not sure if it would encourage to use git somebody who doesn't know much about version control. Somebody who know, probably don't need it because commands like "git log", "git add" and "git commit" are quite obvious for someone who used SVN or other version control system.


I get an entirely blank page. JavaScript errors.

Win 7, Opera 12.


Pssst, Linux+Chromium.


Right, because a good way to fix errors on a web page is to change your operating system and browser.

I am curious which JavaScript errors you're seeing, though, skrebbel. I don't see anything amiss in the developer console on Safari 5.1.7.


As another Opera 12 + Win7 user, there are 2 errors. A ReferenceError (undefined variable pluginlist when trying to add "Java") and a TypeError (CourseApp.Views.ChallengeMenu is not a constructor).


BTW, people aren't downvoting you because of your convictions as you seem to think according to your profile. They're downvoting you for a complete lack of contribution to the comment thread. That's why people downvote on Hacker News.


>That's why people downvote on Hacker News.

While it certainly isn't as bad as some other sites, I think it is naive to suggest that nobody has ever been downvoted on HN for having an unpopular opinion.


Pssst, what?


The tutorial guides you through using some git commands, but it doesn't let you deviate. It encouraged me to make up commit messages, but when I look at the log it apparently ignored my messages and used some other ones. If it's not going to represent the actual experience using git, why bother? It serves only to confuse.


I agree. I kept trying to "ls" and observe what was going on between each command or examine the directory structure of /.git and so on. Only later did I realize that there was a filesystem explorer-like window below.

Also, having them automatically adding files to the directory was kind of confusing. Sometimes I would type a command and something new would appear in the file system as a result of that command. Other times, I would type a command and something new would appear in the filesystem that I suppose was expected to be used for a subsequent step. It would have been nice if these things would have happened in isolation from each other. That way I could run the command, see what happened, and then perhaps click "next" to move onto a different scenario with a new set of files I could add to the repository.


Basic Git is easy. This intro is basic. Just be aware that it can get much more complicated and the answers to how to do it may or may not be readily available via Google.

This guide is like starting the "Couch to 5K" fitness program but knowing that, if you stick with it, eventually you will have to compete in a marathon.


One bit of feedback: it's hard to notice that the Advice box has changed every time you advance a level. Can that be made more obvious? (here's what I'm talking about: http://cl.ly/251P3i2t1k1p3C3U0D0u)


That page is broken. The try.github.com will redirect to http://try.github.com/levels/1/challenges/1 but I got "We're sorry, but something went wrong. (500 Internal Server Error)"


This was working nicely until about step 20, where everything sort of hung. I've deleted cookies, removed the repository, and tried to restart but I am now hung on step 1. (By "hung," I mean: I've issued the command but nothing ever comes back.)


The tutorial seems broken for me.

I'm at the point where you do a git checkout clean_up and then nothing at all happens. You just get the prompt back. If I try git status same thing.

I've reloaded the page multiple times, but same problem.

Maybe Code School needs to work out a few more bugs?


Nice tutorial.

However, it requires giving an app 'try-git' access to your private and public repositories... so afterwards, probably a good idea to edit your profile, click Applications, then remove the try_git app.


I stoped when it asked to create a repo on github. This is not required to lean git. Well tried ;)


Pff...this command line doesn't even know 'ls' :)


Git: the cargo cult SCM. Too much unnecessary voodoo. Given the choice I'd take Mercurial any day.


git: 'clone' is not a git command. See 'git --help'.

What? I don't know if this is allowed later and everything is sandboxed.


Does not work with Opera.


running too slow


I just did this and it was cool. But, if you are a complete beginner to version control in general, it may not be simple to follow. It tries to explain a few things such as creating a branch, checking out etc. but for a complete beginner, this tutorial will be a little bit difficult. Kudos for web based interactive learning though!!


no i dont have 15 minutes




Applications are open for YC Winter 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: