{"thread":{"id":"9682","subject":"Git cheat sheet","startedAt":"2007-08-29T07:46:07Z","lastAt":"2007-08-30T23:49:43Z","messageCount":12,"participants":["Zack Rusin","Rene Herman","Junio C Hamano","Matthieu Moy","Nguyen Thai Ngoc Duy","Karl Hasselström","Dan Chokola","Bernt Hansen","Dan Zwell"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"51776","messageId":"46D5243F.3040007@gmail.com","threadId":"9682","inReplyTo":"200708290348.02853.zack@kde.org","subject":"Re: Git cheat sheet","fromName":"Rene Herman","fromEmail":"rene.herman@gmail.com","sentAt":"2007-08-29T07:46:07Z","receivedAt":"2007-08-29T07:46:07Z","isPatch":false,"sender":{"key":"rene.herman@gmail.com","avatar":null},"body":"On 08/29/2007 09:48 AM, Zack Rusin wrote:\n\n> I took a short break from being insanely handsome (which takes a lot of my \n> time - gorgeous doesn't just happen) and based on similar work for Mercurial \n> created a little SVG cheat sheet for Git.\n\n[ ... ]\n\n> Sample png's are here:\n> http://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png\n> http://ktown.kde.org/~zrusin/git/git-cheat-sheet-large.png\n\nYes, well, screw those, it's pictures of _you_ we want!\n\nRene.\n"},{"id":"51775","messageId":"200708290348.02853.zack@kde.org","threadId":"9682","inReplyTo":null,"subject":"Git cheat sheet","fromName":"Zack Rusin","fromEmail":"zack@kde.org","sentAt":"2007-08-29T07:48:02Z","receivedAt":"2007-08-29T07:48:02Z","isPatch":false,"sender":{"key":"zack@kde.org","avatar":null},"body":"Hey, \n\nI took a short break from being insanely handsome (which takes a lot of my \ntime - gorgeous doesn't just happen) and based on similar work for Mercurial \ncreated a little SVG cheat sheet for Git. I'm not sure if it's going to be \nuseful for anyone else (the target audience was composed of engineers who \nagreed to move to and work from Norway so you know right of the bat that \nhistorically they already made some bad decisions), but the times when I do \nart are so rare that I feel the need to share.\n\nThe thing that I took from the Mercurial sheet, besides the idea, is the \nflow-chart (people dig icecream and flow-charts, the first one is really hard \nto get into a SVG rendering so I went with the second) so the license is the \nsame as of the Mercurial sheet which was Creative Commons.\nThere's likely a few errors in it and if you have any suggestions or if you \nsport latex pants and a fancy green hairdo that goes with those pants (which \nequals the fact that you're an artist) and would like to pimp the sheet out, \nit would be my pleasure to help you. \n\nThe SVG is at:\nhttp://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg\nSample png's are here:\nhttp://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png\nhttp://ktown.kde.org/~zrusin/git/git-cheat-sheet-large.png\n\nwith much (platonic) love,\nz\n"},{"id":"51778","messageId":"7vfy22squc.fsf@gitster.siamese.dyndns.org","threadId":"9682","inReplyTo":"200708290348.02853.zack@kde.org","subject":"Re: Git cheat sheet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-29T08:11:07Z","receivedAt":"2007-08-29T08:11:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Zack Rusin <zack@kde.org> writes:\n\n> http://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg\n\nNice drawing and no typo.  Very nicely done.\n\nSome minor nits (-), improvement suggestions (+), and\ncorrections (*).\n\n- Recommended form for diff between 1 and 2 is \"git diff $id1\n  $id2\", not dotted form \"$id1..$id2\"\n\n+ \"git log -p $file\" gives a false impression that it is about a\n  single file.  Better written as \"git log -p $file $dir/ec/tory/\"\n  to suggest both usage.\n\n- Although they do the same thing (\"annotate\" is there only for\n  backward compatibility) \"git blame\" is recommended over \"git\n  annotate\", if only because that's the command name more often\n  talked about in the community.  If you are going to list only\n  one, blame is the name to keep.\n\n+ To start from a particular revision, use \"git blame $version $file\".\n\n- \"git reset --hard HEAD\"; you do not have to write HEAD there.\n\n- \"Revert\" has a specific meaning to git but people from\n  different background interpret the word differently.  Both\n  \"git revert HEAD\" and \"git revert $id\" are about creating a\n  new commit to reverse the effect of the named commit.\n\n* \"git pull $branch1 $branch2\" is wrong.  If you are merging\n  branch1 into branch2, you need to be on branch2 (i.e. have\n  done \"git checkout branch2\") and then say \"git merge branch1\".\n\n+ \"git commit\" is not about publishing at all.  A major point\n  about distributed SCMs is that unlike centralized systems, the\n  act of committing is separate from the act of publishing.\n  IOW, you can make commits without having to worry about\n  publishing that to the public, and that allows you to more\n  freely experiment.\n\n+ A new section \"Making Progress\" and include commit, merge and\n  rebase there, perhaps?\n"},{"id":"51780","messageId":"vpqk5repwpz.fsf@bauges.imag.fr","threadId":"9682","inReplyTo":"7vfy22squc.fsf@gitster.siamese.dyndns.org","subject":"Re: Git cheat sheet","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-08-29T08:32:24Z","receivedAt":"2007-08-29T08:32:24Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Zack Rusin <zack@kde.org> writes:\n>\n>> http://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg\n>\n> Nice drawing \n\nTrue!\n\n> and no typo.\n\nExcept for the blue closing parenthesis for (git-config --help), while\nthe opening one is black ;-).\n\n> + \"git commit\" is not about publishing at all.\n\nIt does not publish in itself, but it's mostly necessary in order to\npublish. For a short summary, I think it's OK to have it in the\npublishing section, as long as it's just before \"format-patch\" and\n\"push\".\n\notherwise, about the suggested flow on the top right, I'd move\n\"commit\" to the left. Most of the time, \"commit\" comes before pull or\nfetch. It normally comes before \"revert\", but after \"reset\" (revert\ncreates a new commit, you want to do it from a clean tree, so either\nreset or commit before).\n\n-- \nMatthieu\n"},{"id":"51789","messageId":"fcaeb9bf0708290234m77702f87o3d6169fa0ea1f431@mail.gmail.com","threadId":"9682","inReplyTo":"200708290348.02853.zack@kde.org","subject":"Re: Git cheat sheet","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2007-08-29T09:34:26Z","receivedAt":"2007-08-29T09:34:26Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Great.\n\nI would like to translate it into Vietnamese (with xml2po). Can you\nplease do me a favor making \"Git Cheat Sheet\" at the top left a\ncontinuous string?  Also it would be great if the text \"the curves\nindicate...\"  is a continuous paragraph. I have no idea if it can be\nachieved with inkscape/svg though.\n\nThank you.\n\nOn 8/29/07, Zack Rusin <zack@kde.org> wrote:\n> Hey,\n>\n> I took a short break from being insanely handsome (which takes a lot of my\n> time - gorgeous doesn't just happen) and based on similar work for Mercurial\n> created a little SVG cheat sheet for Git. I'm not sure if it's going to be\n> useful for anyone else (the target audience was composed of engineers who\n> agreed to move to and work from Norway so you know right of the bat that\n> historically they already made some bad decisions), but the times when I do\n> art are so rare that I feel the need to share.\n>\n> The thing that I took from the Mercurial sheet, besides the idea, is the\n> flow-chart (people dig icecream and flow-charts, the first one is really hard\n> to get into a SVG rendering so I went with the second) so the license is the\n> same as of the Mercurial sheet which was Creative Commons.\n> There's likely a few errors in it and if you have any suggestions or if you\n> sport latex pants and a fancy green hairdo that goes with those pants (which\n> equals the fact that you're an artist) and would like to pimp the sheet out,\n> it would be my pleasure to help you.\n>\n> The SVG is at:\n> http://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg\n> Sample png's are here:\n> http://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png\n> http://ktown.kde.org/~zrusin/git/git-cheat-sheet-large.png\n>\n> with much (platonic) love,\n> z\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n\n\n-- \nDuy\n"},{"id":"51797","messageId":"20070829100407.GA28853@diana.vm.bytemark.co.uk","threadId":"9682","inReplyTo":"7vfy22squc.fsf@gitster.siamese.dyndns.org","subject":"Re: Git cheat sheet","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-08-29T10:04:07Z","receivedAt":"2007-08-29T10:04:07Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-08-29 01:11:07 -0700, Junio C Hamano wrote:\n\n> - \"git reset --hard HEAD\"; you do not have to write HEAD there.\n\nThere should also probably be a warning about any local changes being\nirretrievably lost. (The existing warning is kind of vague.)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"51812","messageId":"200708290855.39505.zack@kde.org","threadId":"9682","inReplyTo":"7vfy22squc.fsf@gitster.siamese.dyndns.org","subject":"Re: Git cheat sheet","fromName":"Zack Rusin","fromEmail":"zack@kde.org","sentAt":"2007-08-29T12:55:39Z","receivedAt":"2007-08-29T12:55:39Z","isPatch":false,"sender":{"key":"zack@kde.org","avatar":null},"body":"\nThanks a lot for the comments.\n\nOn Wednesday 29 August 2007 04:11:07 am Junio C Hamano wrote:\n> - Recommended form for diff between 1 and 2 is \"git diff $id1\n>   $id2\", not dotted form \"$id1..$id2\"\n\nFixed. \n\n> + \"git log -p $file\" gives a false impression that it is about a\n>   single file.  Better written as \"git log -p $file $dir/ec/tory/\"\n>   to suggest both usage.\n\nFixed.\n\n\n> - Although they do the same thing (\"annotate\" is there only for\n>   backward compatibility) \"git blame\" is recommended over \"git\n>   annotate\", if only because that's the command name more often\n>   talked about in the community.  If you are going to list only\n>   one, blame is the name to keep.\n\nFixed.\n\n> + To start from a particular revision, use \"git blame $version $file\".\n\nI'm not quite sure where to squeeze it though :)\n\n> - \"git reset --hard HEAD\"; you do not have to write HEAD there.\n\nThe reason I left HEAD in there was because I wanted to let people know they \ncan reset to any id, but come to think of it, I failed at that (and only at \nthat, everything else in my life is a success... cough, cough) so I removed \nHEAD.\n\n> - \"Revert\" has a specific meaning to git but people from\n>   different background interpret the word differently.  Both\n>   \"git revert HEAD\" and \"git revert $id\" are about creating a\n>   new commit to reverse the effect of the named commit.\n\nI added a note to let people know it creates a new commit.\n\n> * \"git pull $branch1 $branch2\" is wrong.  If you are merging\n>   branch1 into branch2, you need to be on branch2 (i.e. have\n>   done \"git checkout branch2\") and then say \"git merge branch1\".\n\nAh, thanks! Fixed. \n\n> + \"git commit\" is not about publishing at all.  A major point\n>   about distributed SCMs is that unlike centralized systems, the\n>   act of committing is separate from the act of publishing.\n>   IOW, you can make commits without having to worry about\n>   publishing that to the public, and that allows you to more\n>   freely experiment.\n\nThe reason I put it in publishing was because if I added another section I'd \nhave to resize the font to about 2pt to fit it all which in turn would imply \nthat everyone trying to read the sheet would be crosseyed (and given my \nstrong support for beauty in the community, I just couldn't do that). \n\n> + A new section \"Making Progress\" and include commit, merge and\n>   rebase there, perhaps?\n\nYeah, lack of rebase in the sheet bothers me a bit, since it's quite \nimportant. Maybe I could remove the \"useful commands\" section and put \nsomething in there...\n\nAlso I think that it's very important to specify what a \"cheat sheet\" is for. \nIt's not a replacement for a tutorial. I don't think it's reasonable to \nexpect anyone to print this sheet without reading any tutorials/documentation \nand be riding the Git wave. It nicely complements the tutorial, especially in \nthe beginning phases of learning something new. \nSo what I wanted to have on this sheet is list of thingies (technical term) \npeople will use on a daily basis. In cases they need a specific permutation \nof them they can always look at the documentation.\nSo in my opinion (and that's a wicked good opinion) the scenario we should be \naiming at with a cheat sheet is:\n1) a person hears about Git in an online dating forum\n2) a person takes a deep breath and changes pants\n3) a person reads the tutorial\n4) a person prints a cheat sheet and begins using Git\n\nWhile I think 1 and 2 will change and are fairly optional, I think 3 \nabsolutely has to come before 4. \nBasically I wanted this to be a road-sign that would point people in the right \ndirection (and I know that people from Brooklyn, are all confused right now \nbecause every roadsign they've ever seen points the wrong direction, but they \ncan trust me, outside Brooklyn roadsigns actually point in the right \ndirection).\n\nI'm not sure if I should put the sheet in some more visible place, so for now \nthe updated svg and png's are at:\nhttp://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg\nhttp://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png\nhttp://ktown.kde.org/~zrusin/git/git-cheat-sheet-large.png\n\nz\n"},{"id":"51819","messageId":"61e816970708290647r50f4d079k8e0984527bcdbe2e@mail.gmail.com","threadId":"9682","inReplyTo":"200708290855.39505.zack@kde.org","subject":"Re: Git cheat sheet","fromName":"Dan Chokola","fromEmail":"dan@chokola.com","sentAt":"2007-08-29T13:47:42Z","receivedAt":"2007-08-29T13:47:42Z","isPatch":false,"sender":{"key":"dan@chokola.com","avatar":null},"body":"On 8/29/07, Zack Rusin <zack@kde.org> wrote:\n> Thanks a lot for the comments.\n>\n\nOne more. You might want to add git apply to the \"Change\" part of the\ncommand sequence.\n\n-- \nDan Chokola\n"},{"id":"51835","messageId":"vpq3ay2jp1c.fsf@bauges.imag.fr","threadId":"9682","inReplyTo":"200708290855.39505.zack@kde.org","subject":"Re: Git cheat sheet","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-08-29T16:14:55Z","receivedAt":"2007-08-29T16:14:55Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Zack Rusin <zack@kde.org> writes:\n\n>> + A new section \"Making Progress\" and include commit, merge and\n>>   rebase there, perhaps?\n>\n> Yeah, lack of rebase in the sheet bothers me a bit, since it's quite \n> important. Maybe I could remove the \"useful commands\" section and put \n> something in there...\n\nBut be carefull with rebase: it's easy to shoot yourself in the foot\nwith it (try rebasing a branch you've already published, and which\npeople already branched from if you want to see ;-) ). Putting it on a\n\"cheat sheet\" increase the risk of seeing people using it without\nknowing about the risk.\n\n> I'm not sure if I should put the sheet in some more visible place, so for now \n> the updated svg and png's are at:\n\nJust linking to them from the git wiki would be nice already.\n\n-- \nMatthieu\n"},{"id":"51892","messageId":"87d4x5di9y.fsf@gollum.intra.norang.ca","threadId":"9682","inReplyTo":"7vfy22squc.fsf@gitster.siamese.dyndns.org","subject":"Re: Git cheat sheet","fromName":"Bernt Hansen","fromEmail":"bernt@alumni.uwaterloo.ca","sentAt":"2007-08-29T23:37:29Z","receivedAt":"2007-08-29T23:37:29Z","isPatch":false,"sender":{"key":"bernt@norang.ca","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Zack Rusin <zack@kde.org> writes:\n>\n>> http://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg\n>\n> Nice drawing and no typo.  Very nicely done.\n>\n\nOne typo:\n\nTitle \"To view the merge conclicts\" under Resolve Merge Conflicts.\n\nNice job :)\n\n-Bernt\n"},{"id":"51868","messageId":"87k5rdbrat.fsf@totally-fudged-out-message-id","threadId":"9682","inReplyTo":"7vfy22squc.fsf@gitster.siamese.dyndns.org","subject":"Re: Git cheat sheet","fromName":"Bernt Hansen","fromEmail":"bernt@alumni.uwaterloo.ca","sentAt":"2007-08-30T04:05:47Z","receivedAt":"2007-08-30T04:05:47Z","isPatch":false,"sender":{"key":"bernt@norang.ca","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Zack Rusin <zack@kde.org> writes:\n>\n>> http://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg\n>\n> Nice drawing and no typo.  Very nicely done.\n>\n\nOne typo:\n\nTitle \"To view the merge conclicts\" under Resolve Merge Conflicts.\n\nNice job :)\n\n-Bernt\n"},{"id":"51964","messageId":"46D75797.8010007@gmail.com","threadId":"9682","inReplyTo":"200708290348.02853.zack@kde.org","subject":"Re: Git cheat sheet","fromName":"Dan Zwell","fromEmail":"dzwell@gmail.com","sentAt":"2007-08-30T23:49:43Z","receivedAt":"2007-08-30T23:49:43Z","isPatch":false,"sender":{"key":"dzwell@gmail.com","avatar":null},"body":"Zack Rusin wrote:\n> Hey, \n> \n> I took a short break from being insanely handsome (which takes a lot of my \n> time - gorgeous doesn't just happen) and based on similar work for Mercurial \n> created a little SVG cheat sheet for Git.\n...\n> The SVG is at:\n> http://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg\n> Sample png's are here:\n> http://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png\n> http://ktown.kde.org/~zrusin/git/git-cheat-sheet-large.png\n> \n\nI noticed that the cheat sheet listed the options \"--theirs\", \"--ours\", \nand \"--base\" for git-diff. These aren't in git-diff's manpage. A little \ngrep-fu showed me that these are options of git-diff-files, but \nshouldn't they be documented with the porcelain, if the porcelain \naccepts them as options? (I normally use a text editor to view and \nresolve conflicts, but the presence of these options on a cheat sheet \nindicates that they are somewhat important.)\n\nThanks,\nDan\n"}]}