RBVanDyke (4) [Avatar] Offline
#1
In Learn Git in a Month of Lunches, I tried but failed to find answers to the questions asked as follows.

6.4.1. Understanding command-line nuances

To further explore the command line, answer the following questions:

1. What is another way to call git diff --staged?

2. What is the short form of git add --dry-run?

3. (I could answer this one without off the top of my head. ANS: cat -n [file name])

4. The --oneline switch that you passed to git log is shorthand for a longer git log command. What is it?

5. The -a switch to git commit (to automatically pass files to git add) has a longer alternative switch that is surprisingly not --add. What is it?

I tried searching both the book and the Web and came up empty.

Moreover, I'm not going to wade through the entire body of Git documentation trying to answer these questions. Not because I'm lazy, but because I believe these questions are unhelpfully arcane in a book targeted towards readers trying to get started with Git.

Cheers & thanks,
Riley
SFO
rickumali (130) [Avatar] Offline
#2
Hi Riley,

Thanks for posting this question to the forums!

The answer guide PDF contains the answers for 6.4.1. This PDF is at:

http://tech.rickumali.com/learngit/

I'll have to work with Manning to get the PDF link on their website!

It was not my intention to have you wade through the entire body of Git documentation. The unstated goal was to access the help command for the respective commands in this section. For 6.4.1, type the following for the respective question:

1. git diff --help (then search for staged)
2. git add --help (then search for dry-run)
4. git log --help (then search for --oneline)
5. git commit --help (then search for -a)

Thank you for reading!
RBVanDyke (4) [Avatar] Offline
#3
Thx!