Subject: Re: Git cheat sheet

From: Junio C Hamano <[email-masked]>
Date: Wed, 29 Aug 2007 01:11:07 -0700

Zack Rusin <[email-masked]> writes:

> http://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg

Nice drawing and no typo.  Very nicely done.

Some minor nits (-), improvement suggestions (+), and
corrections (*).

- Recommended form for diff between 1 and 2 is "git diff $id1
  $id2", not dotted form "$id1..$id2"

+ "git log -p $file" gives a false impression that it is about a
  single file.  Better written as "git log -p $file $dir/ec/tory/"
  to suggest both usage.

- Although they do the same thing ("annotate" is there only for
  backward compatibility) "git blame" is recommended over "git
  annotate", if only because that's the command name more often
  talked about in the community.  If you are going to list only
  one, blame is the name to keep.

+ To start from a particular revision, use "git blame $version $file".

- "git reset --hard HEAD"; you do not have to write HEAD there.

- "Revert" has a specific meaning to git but people from
  different background interpret the word differently.  Both
  "git revert HEAD" and "git revert $id" are about creating a
  new commit to reverse the effect of the named commit.

* "git pull $branch1 $branch2" is wrong.  If you are merging
  branch1 into branch2, you need to be on branch2 (i.e. have
  done "git checkout branch2") and then say "git merge branch1".

+ "git commit" is not about publishing at all.  A major point
  about distributed SCMs is that unlike centralized systems, the
  act of committing is separate from the act of publishing.
  IOW, you can make commits without having to worry about
  publishing that to the public, and that allows you to more
  freely experiment.

+ A new section "Making Progress" and include commit, merge and
  rebase there, perhaps?