Udacity lesson 3 Flashcards
display information about the existing commits
with cd situate bash in a directory with a repo
git log
display information about a given commit
git show
“scroll” through the log to see more updates
j or ↓ to move down one line at a time
d to move by half the page screen
f to move by a whole page screen
quit the “pager”
q
scroll up in Less
k or ↑ to move _up_ one line at a time
u to move by half the page screen
b to move by a whole page screen
how to adjust what a command on the command line will do?
use a flag
ls -l
- here -l is a flag
how to make the git log output shorter?
use the flag –oneline
I want to know which files were changed in the commit. what to do?
git log –stat
what do the numbers mean?
number of lines changed (insertion or delition in the line)
I want to see what exactly the changes in each commit were. How to do that?
git log -p
or –patch, it’s the same
what does this all mean?
diff: difference between the original and the changed versions of the file
a and b are for the first and the second versions of the file. The file is .css, it’s written there
index: the hash of the file before the change and after the change
@@ shows where in the file the edits were made: first what were the lines in the original file (the sequence began at line 38 and lasted 6 lines), the second one - where the lines are in the edited file (begins at 38, lasts 11 lines)
lines in green and with + mean these lines were the actual change, they were added
only look at the specific commit, not on all the commits
git log -whatever_flag first_7_characters_of_SHA
but will show all the commits before this one too
or
git show _flag first_7_characters_of_SHA