git-novice icon indicating copy to clipboard operation
git-novice copied to clipboard

Confusing wording and lack of explanation on Exploring History Episode

Open eshook2010 opened this issue 5 years ago • 2 comments

The section discussing using git diff HEAD states "which is the same as what you would get if you leave out HEAD (try it)" with no explanation as to WHY it would be the same result, which is easy to infer but may not be clear to some learners. Also, the sentence before git diff HEAD~1 says "The real goodness in all this is when you can refer to previous commits" is a bit confusing and does not flow well with the rest of the lesson.

eshook2010 avatar Apr 03 '19 21:04 eshook2010

I agree that explaining it in more detail would be helpful. What about replacing "which is the same as what you would get if you leave out HEAD (try it)" with "HEAD is the default option for git diff, and so omitting it will not change the command's output at all (try it)."

I also agree that the "The real goodness in all this is when you can refer to previous commits" is a bit awkwardly phrased. How about something like "But the real power of git diff is the ability to compare far into the past, to compare with any previous commits. For example, we can look at the commit before HEAD by adding ~1 (where “~” is “tilde”, pronounced [til-duh])."

billbrod avatar Aug 11 '19 23:08 billbrod

The beginning of that episode says

You can refer to the most recent commit of the working directory by using the identifier HEAD.

Which sets up the next section (git diff HEAD is the same as git diff). Does that provide the clarification you're looking for?

kekoziar avatar Jul 31 '21 15:07 kekoziar