🌿

Git & Version Control

A time machine for your code

Track every change, undo mistakes, and collaborate with confidence. Git is the version control system behind almost all modern software.

πŸ“˜ 10 lessonsπŸš€ 1 projectsπŸ—ΊοΈ 1 roadmaps🐞 5 error fixes

Git Setup

Install Git, configure it, and make your first commit.

1

Install Git

terminal
# Download from https://git-scm.com

What it does

Git is the command-line tool that records the history of your project.

Why you need it

Every other step β€” committing, branching, pushing to GitHub β€” runs through Git.

Alternatives: GitHub Desktop or your editor's built-in Git UI.

2

Configure your identity

terminal
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

What it does

Git stamps each commit with your name and email.

Why you need it

So your contributions are attributed correctly on GitHub and in history.

3

Start a repo & first commit

terminal
git init
git add .
git commit -m "Initial commit"

What it does

Initialize a repository, stage your files, and save the first snapshot.

Why you need it

This creates the history that lets you track and undo changes.

4

Push to GitHub

terminal
git remote add origin <url>
git push -u origin main

What it does

Connect your local repo to a GitHub repository and upload it.

Why you need it

A remote backs up your code and enables collaboration and deployment.