Git and GitHub: The Complete Git and GitHub Course
https://learning.oreilly.com/videos/git-and-github/9781800204003

Download & install software on computer:
http://git-scm.com

Download book:
https://git-scm.com/book/en/v2

Links for help:
https://stackoverflow.com/questions/40818354/vs-code-git-folder-file-hidden

VSCode Git gutter stays around sometimes #43092
https://github.com/Microsoft/vscode/issues/43092
Worked for me: right click on project folder, select "open with code"
VSCode  - FILE MARKERS:

A - Added (This is a new file that has been added to the repository)
M - Modified (An existing file has been changed)
D - Deleted (a file has been deleted)
U - Untracked (The file is new or has been changed but has not been added to the repository yet)
C - Conflict (There is a conflict in the file)
R - Renamed (The file has been renamed)
OPEN GIT BASH:
COMMANDS if Desktop is on your Onedrive:  (smart to have like this)
 cd Onedrive 
 cd Desktop 
 mkdir gitProject 
 
 USE VISUAL STUDIO CODE: 
 code   gitProject 
 
 OR ENTER INTO FOLDER & USE:  
 cd   gitProject 
 code . 
 
 CREATE GIT REPOSITORY: 
 git init 
 touch   index.html 
 touch   style.css 
 ls or dir 
 
 GIT REPOSITORY STATUS: 
 git status 
 
 REMOVE PREVIOUS COMMITS: 
 git rm   --cached index.html 
 git rm   --cached style.css

COMMAND HELP
 git init  --help 

 NOTE: 
Files either marked tracked or un-tracted (no snapshots made yet) 

 IN VSCode, 
Edit index.html by pressing 
!+tab       (to make a default markup file) 

ADD A NEW FILE FOR TRACKING:  (STAGED file) 
 git add index.html  <---- if more files, add space then add next file name
git add   index.html   style.css
or
git add  .    <--- all files

 TO COMMIT THE STAGED FILE: 
 git commit   -m   "Initial Commit"  <----- any message to describe the snapshot
*** Please tell me who you are. to set your account's default identity. Omit --global to set the identity only in this repository. 
Run:
git config   --global   user.email "you@example.com"
git config   --global   user.name "Your Name"
VERIFY STATUS:
git config   --global   user.email  
git config   --global   user.name
ENTER COMMAND again  to COMMIT:    (This isn't a backup but snapshot reference of what your files look like.)
git commit   -m   "Initial Commit"
CHECK REPOSITORY STATUS:    
(should show after a commit: "nothing to commit")
git status
ADD MORE FILES:
Example:  script.js
git status  <-----------will show file untracked

git add   script.js  <--- will put file in staging area for a commit

git commit   -m   "Add JS file"
CHECK GIT HISTORY:
git log     <----- shows several lines of chronological order of commits
git log   --oneline    <--- makes lots of commits more truncated for quicker easier viewing
EASY  WAY  TO  COMMIT:
git commit   <----------- this opens COMMIT_EDITMSG in VSCode then add message at top & close file
UNSET VSCode as DEFAULT TEXT EDITOR:
code  ~/.gitconfig   <---------- (~ to navigate to folder of user to open .gitconfig) 
It's global file for every Git repository.
Delete in the file [CORE] and all of editor settings to next [ ***]
OR
git  config  --global  --unset  core.editor
EDIT script.js
git add script.js
& 
git commit   <-------------- default editor (vi) in command window appears
Press any key: for insert mode - then enter a comment at top of file 
Press esc  to leave insert mode
Press:  shift :  w to save
Press: shift : q to quit
USE   VSCode  AGAIN:
git   config   --global   core.editor   "code  --wait"
HEAD (Pointer) to master (tree)
git  show  head    <------- show last commit that head point to tree. (present edit)
OR
git   show  d3e3e85   <---- in git dash highlight the hash ID from git log & it's automatically copied
OR
git   show   head~1  <------------- shows 2nd commit start from head down
REMOVE CHANGES TO FILES before  doing a git add & Git commit: git  checkout  script.js   <------- remove these changes 
CONFIRM 
git  status 
OR ALL FILES REMOVE CHANGES: 
git checkout  . 
OR
 git checkout  *
REMOVE ACTUAL COMMIT  up to  HEAD:       (HEADLESS STATE)
git  log  --oneline  <---------- find HASH ID (highlight for next command)
git  checkout   bbd3e61   <-- headless and use this ID for present state pointer
UNDO REMOVAL of COMMIT with ABOVE COMMAND:
If another commit occurs after last checkout this command puts the MASTER --> HEAD back but the new commit is lost.
git checkout master
OR
git switch -
CHECK WITH
git log--oneline

NOTE:
checkout is a read-only command. 
You can go back in time but can't change anything, back in time. 
When you put the head back on, nothing is changed.

EXAMPLE:
git log --online <------ find hash ID of commit to revert  
git revert ###### <----- revert this change but keep every commit to head and add this change commit to head.
REMOVE COMMITS:
USE  - git reset with 3 optional flags
( default flag --mixed (unstaged), --soft(staged), --hard)
1. CHECK WITH:
git log--oneline  <--- find hash ID to remove above it

2. run commands to unstage
git  reset  --mixed  ######  <----- will unstage those commits. Check:
git  log  oneline   <---- show the commits are removed but not from files
git  status  <---- show the commits are unstaged

3.  REMOVE CHANGES FROM FILES PERMANENLY when unstaged:
git checkout .  <---- check:
git status

if
git reset --soft ###### <----- will stage those commits. Check:
git log oneline <---- show the commits are removed but not from files
git status <---- show the commits are staged

use to unstage:
git reset .

then:
git  checkout  .  <--- removes unstaged commit

REMOVE EVERYTHING  ABOVE HASH ID:
git  reset  --hard  #####
HOW TO IGNORE A FILE:
Create fire - Use extension .gitignore   <-- alway create when new repository.
Create your other files.
Put file names in .gitignore file with /file name

IF YOU MADE CHANGES BEFORE YOU included in .gitignore:
git  rm  -r  --cached  .  <---- remove from cache

then run 
git status  <------ those files should be gone & staged (green)
then run
git  reset  . <----- files unstaged (red)
then run
git  checkout  . <----- removes any unstaged files. Check:
git status
MAKE FOLDER WITH SEVERAL TXT files
# comment  <---- .gitignore file
 # Autogenerated files
auto-gen-files/a.txt
auto-gen-files/b.txt
auto-gen-files/c.txt

IF HUNDRED OF FILES:
# Autogenerated files
auto-gen-files/*   <--- works too
OR
auto-gen-files/*.txt  <--- works too just for txt files only

TO ADD FILE to STAGE for COMMIT in FOLDER:
git  add  auto-gen-files/about.html
LAST NOTE:
You must add and commit  .gitignore  file
git  add  .gitignore
git  commit  -m  "Prepared  .gitignore file"
CREATE REPOSITORY ON GITHUB:
Use push commands: <--- to get your local files on gitHub
git remote add origin https://github.com/########  <--- generated by the GitHub repository for connection
git push -u origin master  <-- to push the local files to gitHub
CHANGE AUTHOR of PREVIOUS NEW COMMITS to PUSH:
git config --global user.name  #######
git config --global user.email  #######

MAKE CHANGE NOW IN INDEX.HTML FILE:
git  add  index.html
git  commit  -m  " Added new H1 tag title"
git push -u origin master
Git & GitHub