Congratulations

Introduction to Git

George Boorman

Curriculum Manager, DataCamp

Chapter 1 recap

  • Benefits and applications of Git for version control
  • Navigating the terminal - ls, cd
  • How to initiate a Git project - git init
  • How to use Git to track your files - git add ., git commit -m
Introduction to Git

Chapter 2 recap

  • How Git stores data

    1. Commit
    2. Tree
    3. Blob
  • git log

    • 3
    • --since
    • --until
  • git show c27fa856

Diagram showing three commits, with the files committed linked to the tree, and each file linked to the blob of the last commit they were a part of

Introduction to Git

Chapter 2 recap

Command Function
git diff report.md Show changes between unstaged file and the latest commit
git diff --staged report.md Show changes between staged file and the latest commit
git diff 35f4b4d 186398f Show changes between two commits using commit hashes
git diff HEAD~1 HEAD~2 Show changes between two commits using HEAD syntax
Introduction to Git

Chapter 2 recap

Command Result
git revert HEAD Revert all files from a given commit
git revert HEAD --no-edit Revert without opening a text editor
git revert HEAD -n Revert without making a new commit
git checkout HEAD~1 -- report.md Revert a single file from the previous commit
git restore --staged report.md Remove a single file from the staging area
git restore --staged Remove all files from the staging area
Introduction to Git

What's next?

  • Branches
  • Remote repos
  • Rebasing
  • Bisecting
  • Submodules
Introduction to Git

Congratulations

Introduction to Git

Preparing Video For Download...