Monday, September 10, 2007

Git cheat sheet

Due to the fact that I've been moving I forgot to point out that about three weeks ago I created a small Git cheet sheet. Quoting my email to the Git mailing list: I took a short break from being insanely handsome (which takes a lot of my time - gorgeous doesn't just happen) and based on similar work for Mercurial created a little SVG cheat sheet for Git. I'm not sure if it's going to be useful for anyone else (the target audience was composed of engineers who agreed to move to and work from Norway so you know right of the bat that historically they already made some bad decisions), but the times when I do art are so rare that I feel the need to share.

The thing that I took from the Mercurial sheet, besides the idea, is the flow-chart (people dig icecream and flow-charts, the first one is really hard to get into a SVG rendering so I went with the second) so the license is the same as of the Mercurial sheet which was Creative Commons. There's likely a few errors in it and if you have any suggestions or if you sport latex pants and a fancy green hairdo that goes with those pants (which equals the fact that you're an artist) and would like to pimp the sheet out, it would be my pleasure to help you.




The SVG is at:
http://byte.kde.org/~zrusin/git/git-cheat-sheet.svg
Sample png's are here:
http://byte.kde.org/~zrusin/git/git-cheat-sheet-medium.png
http://byte.kde.org/~zrusin/git/git-cheat-sheet-large.png

I also got up to speed on all the latest announcements. I thought that the Novell's Spotlight collaboration announcement was disappointing. I'm referring to the "Microsoft will provide Novell the specifications for Silverlight".

Richard Leakey once said "We are human because our ancestors learned to share their food and their skills in an honored network of obligation". I love that quote because it so beautifuly describes what we, so heavly, rely on in the Open Source community. For a company to take from the great ocean of free knowledge, led by an open standard of SVG and end up with a closed specification is just disgusting. Seeing an Open Source company strike a deal to cooperate on that closed technology is just sad to me. I understand why they did it but understanding something doesn't make it morally right.

I really hope, pointlessly as it might be, that the work on the Silverlight specification and the specification itself will be open. You obviously thought that SVG isn't good enough for your purposes and you built on top the experiences and ideas taken from SVG. Let us improve SVG based on your experiences and ideas. Once we've done that, you'll be able to repeat that process again. That's the way it works and that's the way our society has always worked.

Despite what you might think, you don't own ideas, they belong to us all.

43 comments:

Anonymous said...

can you give a link to the mentioned mercurial cheat sheet, please.

Anonymous said...

http://www.ivy.fr/mercurial/ref/v1.0/

PDF, PNG, and SVG Format are here. It is also linked to from the hg wiki if you lose this link.

I like the color scheme Zack picked for his sheet. It's very nice. :-)

elvis said...

Ah this is great Zack. Now I just might try this new-fangled Git thing!

Anonymous said...

How do you create such beautiful layout, Zach ?

Gimp ?

-- the ignorant

Anonymous said...

If you look at the source code of the SVG with a text editor it says it was created with Inkscape 0.45.1.

Anonymous said...

If that's actually made with Inkscape, I have to wonder whether it would be more efficient to come up with something like LaTeX Beamer for these sorts of projects - pre-themed or slightly customizable.

ulrik said...

it looks great. I printed it.

Anonymous said...

wow. great!

Anonymous said...

Wow, your post was linked by Version Control Blog.

PS: Good work

Anonymous said...

Zack do u think such a cheat sheet would be usefull on wikipedia?!
IMO i got more an idea on whats GIT
doin from ur sheet then from the desciption at wikipedia ;)

Anonymous said...

As a buffered consciousness, one would suppose that Norway would possess some of the world's finest ice cream. Alas, much like the inuit, of dog eating fame, the spastics declared war on all things chilly and dairy cows were ordained lovers rather than tits with legs, which we all know they are. If your have had several strokes, and have lost the ability to differentiate between creamy ice cream goodness, and frozen processed fish ball, then Norway becons, with a big luscious icecream cone in its hand. Enjoy Mr Zander!! Have some sprinkles, which are actually arctic rat turds.

jim said...

Thank you thank you thank you!

By the way, please change the date format in your blogger template to show dates for comments! It shows only the time, not the date.

Anonymous said...

Beautiful. Thanks for putting this together.

Here's a PDF of it.

Anonymous said...

Not sure if already around, but here's an A4 version of this really great cheat sheet for european printers:

git-cheat-sheet-a4.pdf

git-cheat-sheet-a4.svg

sam

Anonymous said...

Bottom right hand corner: "merge conclicts"

Anonymous said...

one useful thing that's not mentioned (and that I didn't find in any of the git tutorials either):

git checkout -f

This is the same as "svn revert": it undoes any local changes you've made since the last checkout.

jim said...

So:
git checkout -f
is similar to:
git reset --hard

Is this correct?

Unknown said...

@jim: you're right, I missed that one! They're not just similar, by reading up on git I saw they do the same thing. I guess I didn't notice since "git reset" is mostly used to remove whole commits (like in "git reset --hard HEAD^". Thanks.

jim said...

I imagine there might be some difference between "git checkout -f" and "git reset --hard". But the documentation says that "git reset --hard" is used by "git stash", so if there is a difference I think it that "reset" is probably cleaner.

I suspect the difference might be that "git checkout -f" perhaps leaves new files (those added with "git add") whereas reset would remove them? Not sure -- just speculating.

Anonymous said...

Great Work Zack. I've posted the cheat sheet on http://TechCheatSheets.com

-Steven

Anonymous said...

This is a great site. Thank you for your information. I THANK YOU I SALUTE YOU IT,S A AMZING SITE.

Ten above said...

Thanks Sam and Zack!

Unknown said...

Zack,
I just send you an email to your KDE.org email address with an updated version of the sheet.
I would like to further improve it, just let me know if you like it and if I should contact you on a different email address (that's the only I found out).

Thanks.

Murad said...

Thank you a lot.

Anonymous said...

Thank you for your nice cheat sheet.
I translated into Japanese.
http://www.textdrop.net/document/git-cheat-sheet-ja/

dilipm79 said...

It's precise.

Anonymous said...

Zack, if possible... a PDF of this, please.

Adda said...

Hi,

I would like to translate your in french this work. Could you pls send me the templates ?

It will be helpful for my students to understand and use Git :-)

Thanks in advance,

Addame

Anonymous said...

Thanks for this . . . I'm printing off a few of these for a quick reference (so friends of mine don't keep bugging me on how to do something with git . . .).

Anonymous said...

There seems to be a problem accessing the cheatsheets.

:(

Anonymous said...

Another useful (but really powerful / dangerous): git rebase -i HEAD~10 will show the last 10 commits. You can squash them down into a single commit, edit a commit, or (this is the dangerous part) delete a line and it will delete that commit.

I also expand on the tagging. My tag (have to always look this up): git tag -s -m "Ready for prime time" 1.0 will pgp sign the tag (looks up via the author email). This way someone can verify that it was actually me that tagged it and not some random person.

Igor Milovanović said...

Thanks! Very usefull.

Geshan Manandhar said...

Very good cheat sheet.

Hylke said...

I don't have green hair but I restyled your work :)
http://www.flickr.com/photos/26546578@N06/4193814990/
I left out some stuff like bisec because I don't use that (yet)

e40 said...

If you "git format-patch origin" and you've switched branches since you cloned, it will do the wrong thing. So, the best way to specify it is "git format-patch origin/$branch" where $branch is the branch you are on.

Anonymous said...

Git add should really be in there. Git add --patch is especially useful.

Anonymous said...

cheat sheet links are broken!

Edward Garson said...

all links broken :-(

Anonymous said...

Links dead, indeed. But thank you anyway.

Joe Good said...

The only link that still appears to work is the one where somebody copied it up to Flickr:

http://www.flickr.com/photos/26546578@N06/4193814990/in/photostream/lightbox/

Joe Good said...

http://appletree.or.kr/quick_reference_cards/cvs-subversion-git/git-cheat-sheet.pdf

Different take based on Zack's original work.

jim said...

Joe, thanks for the new link! Looks interesting.

Stephanie said...

I added the original files to a git repository.

https://github.com/nerdgirl/git-cheatsheet-visual