Git for EngineersIntroduction to Git

Introduction to Git

Free preview

What is Git and why should engineers care?

~10 min read

Introduction to Git

Git is a distributed version control system created by Linus Torvalds in 2005.

Why Git?

  • Track every change to your codebase
  • Collaborate without overwriting each other's work
  • Roll back mistakes instantly
  • Branch freely, merge confidently

Core concepts

  • Repository: the database of all your project history
  • Commit: a snapshot of your files at a point in time
  • Branch: a pointer to a commit
  • Working tree: your current files on disk

Your first repo

git init my-project
cd my-project
echo "# Hello" > README.md
git add README.md
git commit -m "Initial commit"

Congratulations — you just created your first Git repo!