A few days ago, I posted a cheat sheet for Git (just as last time, Git is a really cool revision control system). Let’s face it: it was ugly. Not something you would actually hang up where other people could see it, was it? Here’s the remedy, which also works on both A4 and Letter and is more detailed.

In more detail, the additional details are:

  • The old “structure overview” diagram showing the big picture of repositories and working trees is now a lot bigger and a lot more detailed. It comes along with a glossary, a few notes on getting started, a list of useful tools you may want to look at, and links to the most important websites of all (cough).
  • The whole workflow diagram is gone since it was not really all that clear. Instead, some of the groups of commands are connected with lines, indicating in which sequence you’ll probably use some of these commands.
  • Some commands have shuffled around a bit, and there’s a new box with information on Git’s configuration options.
  • In order to fit it all together, it’s now a two-sided cheat sheet. The “front” side has overview-style things on it and the “back” side is mostly a command reference.

So how’s it look like? Observe:
Thumbnail for Git cheat sheet, version 2

Because Inkscape saw fit to generate annoyingly huge PDF files from the source, this time you get a zipped two-page PDF document as well as the Inkscape source files.

Another thing that I didn’t pay attention to last time was the license. No longer: this cheat sheet is licensed to you under the terms of a Creative Commons Attribution-NonCommercial 3.0 license. For attribution, should you want to create a derived work, please include a mention of http://git.jk.gs/ and, if available space permits, my name.

33 responses to this post

  1. Dennis says:

    I still do not entirely understand the phrase “commercial use”. Obviously I am not allowed to sell your cheat sheet, but may I use it to look up commands when I’m working on a business project?

  2. Jan says:

    Don’t worry: the license covers only modification (reproduction) and distribution. In other words, just looking at the document is not restricted in any way. If, on the other hand, you sold copies of the document or sold your own work based directly on the contents of the document (i.e. copying substantial parts of it), that would be commercial use as restricted by the license. See sections 4b and 3 of the full license text for the gory details.

  3. I referred to your page from my blog, I hope you do not mind :). Thanks for the cheat sheet

  4. Jan says:

    I certainly don’t. Thanks for considering it worth linking to. ;)

  5. Wolfram says:

    Thanks a lot for this one! The “big picture” really helped me to get some things clear and the reference is also very useful. Now I know immediately which man-page to read. I think I will have it in reach always :)

  6. Sounds great and helpful. thx.
    (hello jan!)

  7. Matthias says:

    Hey,

    maybe you’d want to advertise color.ui instead of color.branch, color.diff and color.status.

    I’m not sure if I would describe core.compression. I have never changed this value and consider myself a fairly advanced git user. Maybe point the user to Documentation/config.txt instead? But hey, it’s your cheat sheet and it might be of some value for my co-workers.

    Thanks.

  8. Jan says:

    Thanks for the feedback, Matthias! color.ui is definitely a good thing to put on there. It isn’t because it didn’t exist yet when I made that version of the cheat sheet.

    To be honest, I hadn’t really used Git much myself when I made the cheat sheet. That has changed. I might very well give it a major overhaul when I find the time.

  9. Marius says:

    origin is the default upstream repository, not branch which is stated on your cheat-sheet. (This was correct in Zack’s cheat-sheet, which you based yours on) origin contains all the upstream branches, also the default upstream master branch.
    :-)

  10. Jan says:

    Marius: dang! My excuse is that I did this a long time ago and now know a lot more about Git. I guess I’ll have to fix this so it doesn’t spread needless confusion. Now to find the time to do that…

  11. Johan says:

    Great cheat sheet!

    I’d suggest to remove or lighten the grey background in the boxes in “The Big Picture”. I printed using HP LaserJet 1320nw, and I cannot separate the fat black arrows from the background – the colors are too close. I think one can consider the LaserJet a resonable good printer….

  12. [...] The other excellent cheatsheet I found for get comes from Jan Krueger. Jan’s comes in two pages and also is in SVG. He made them also into a single PDF. This one is slightly easier to read in my opinion, but the only down side is that it has a unnecessary first page. You can get a copy of Jan’s here. [...]

  13. Michelangelo says:

    Hi man, great work indeed! I’ve asked for your sheet to be printed but there seems to be some trouble with fonts; the guy in the shop asked me to “convert chars into curves” in AI file to better print it.
    Is that possible?

    • Jan says:

      I assume by “AI” you mean Adobe Illustrator. I’m afraid I haven’t used that thing yet. If I had to guess, it probably has an “Object” menu with something that can convert text objects to curves/paths. You’d have to open the file, select text objects (and ideally nothing else) and use that, then save the result in a new file. If that doesn’t get you anywhere, I’ll be happy to help, but it may take me a couple of days.

  14. Hey Jan,

    Great cheat sheet. I made a modified version of the back side for myself with a few additions for git-svn. If anyone wants it; PDF | Inkscape SVG.

  15. Michelangelo says:

    Hi Jan; yep, you got it right!:) I’m unable to accomplish that due to the fact I have no AI here and the shop guy uses AI to print SVG files: on that Windows Box everything was screwed up, a total mess, I guess for missing fonts.

  16. katieg says:

    I use GIT at my company for SCM, but we are looking to move off of it because we’re growing in size and need a tool that controls the whole software development process better. We have been evaluating AccuRev and Perforce which is suppose to be a real SCM systems, but they are not cheap. Does anyone have any experience with either of these tools?

  17. [...] ссылки: Git community book Git Guts Why git is better than X Git cheatsheat 1 Git cheatsheat 2 Git cheatsheat 3 (by github team) June 1st, 2009 in Development in general, Enterprise, Linux, [...]

  18. [...] Git Cheat Sheet Extension [...]

  19. [...] Tips & Tricks git ready, learn git one commit at a time Git cheat sheet, extended edition Git Quick Reference From SVN to [...]

  20. alex says:

    Hey Jan,

    thanks for the cheat sheet. I came here through http://www.cheat-sheets.org/

    One comment, though: I am missing the staging area aka. the index in the Big Picture. commit does not transfer changes from the working tree to the repository, but from the index.

    I think, the index is on of the major distinctive features of git and you certainly have to deal with it when you work with git. So it should have it’s place in the Big Picture.

    regards

    alex

    • Jan says:

      Good point. The cheat sheet has a few other inconsistencies and misleading things on it, too, so it’s definitely due for an overhaul. Perhaps I’ll even find some time to actually work on it…

  21. Peter says:

    This is quite helpful. thanks. I’ll check back to see if you update it at all.. Is this post going to let me know of updates? I don’t see a check mark to “subscribe”.

  22. Anonymous says:

    Two years is long enough to find the time, no? ;-)

  23. [...] want to jump right in, then along with the Git model you’ve just read about, the cheat-sheet here should be enough to get started. Share this:TwitterFacebookLike this:LikeBe the first to like this [...]

  24. Eric Davis says:

    I’m going to have to send this to a few clients of mine. They are thinking about switching from svn to git but are getting confused by all of the git commands.

  25. venkatesh says:

    It is good

  26. Joao Araujo says:

    Congratulations, It is a great help and really easy to read.

  27. Hi,

    Thank you for this interesting cheat sheet.

    The PDF is huge because all text is exported as paths. If you re-export it without ticking the “Convert text to path” in the option window that appears, the file size should become a a little saner (here it’s divided by 5).

    My local Inkscape (From Ubuntu 12.04 0.48.3.1 r9886) can easily turn your two SVG into PDF for a total of 100k.
    Unfortunately , it doesn’t interpret very well the layout in the SVG, so several text areas are ill-positioned, and some arrows are wrong, too.

    Which version of inkscape to you use ?

  28. Pierre says:

    Hello,

    thanks for this useful git quickref. As Stéphane Gourichon mentioned, the PDF file is very big (5.8 Mo). I didn’t try to play with the SVG sources but I managed to decrease the size of the PDF file up to 1.2 Mo with the following command:

    gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -sOutputFile=git-cheat-sheet-v2.light.pdf git-cheat-sheet-v2.pdf

    I hope this helped. Cheers.

Leave a reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note that comments that look like link spam (contain a link to a commercial website unrelated to the topic at hand) will be removed. If you are a person getting paid to spam websites... don't bother. It takes me less time to remove your post than it would take you to write it.

Bear