Books & videos i'm learning from on Safari Books.

Safari:
https://learning.oreilly.com/videos/learn-git-in/9781789348231
TERMINAL into downloaded project folder:
make a file called: 
a_test_file.txt
Enter in file:
Welcome to this lesson on using the file system in the terminal!

mkdir   new_folder
mv   a_test_file.txt    new_folder/  (MOVE FILE TO FOLDER)
cd  new_folder
ls
cp   a_test_file.txt   new_test_file.txt    (MAKE COPY)
cat   a_test_file.txt    (WRITE FILE TO TERMINAL OR CONCATENATE FILES) 
rm   new_test_file.txt  (REMOVE FILE)
cd  ..
mv  -r  new_folder/a_test_file.txt  .  (MOVE FILE from folder to current directoy)
rm  new_folder/

==========================================
VI
vi  new_vi_tile.txt  
2 MODES:
** normal mode (for commands)
**  insert mode (to enter text to file) - press i key, esc key to exit

IN COMMAND MODE:       
use arrow keys to move in text file.
use x key to remove charaters
use dd keys to remove whole lines
SAVE FILE:
:wq  <---q for quit or just quit :q
Create Project:
mkdir  my_git_project2
cd  my_git_project2
git init
ls  -a   <---- shows hidden .git folder
vi  new_vi_file.txt
add 1 line of text then save & quit
git add  new_vi_file.txt
add 2nd line of text then save & quit
git status show you added to staging area then make change again to the file. 

Look at difference:
git  diff   <---- shows what added or not yet. press q to quit if needed.
git  diff  --staged  <---- shows added but not yet committed

ONCE ALL STAGED:
git  commit  -v  <-add message at top on file (uses def editor)
git  commit  -m "My 1st commit" <---- won't use editor
git commit -am "My 1st commit" <-- adds all changes and commit
First time file is created  <---------- Untracked status
Then the file will be in 1 of 3 states after it's added to repo.
Unmodified (no change)
Modified (changed - needs added to staging)
Staged (waiting for a final commit)
Git   log   -p  <-- changes in each commit. use  j & k keys to scroll up/down,   type  q  to quit
git  log  -2  <---- show last 2 commits made

git  log  --pretty=oneline  <----- show online for each commit
THERE ARE MANY GIT LOG COMMANDS
To amend a pevious commit:
add file:
git  add  README.md
git  commit  --amend  <----- will open default editor with content of previous commit displayed

Learn-GIT-in-3-Hours