What Is Git?

Git is a distributed version control system used to track changes in code during softwarw development. it allows multiple devlopers to work on a project at the same time without overwriting each other's work.

Why Use Version Control?

Version control lets you:

Installing Git

You can download Git from git-scm.com

After installation, open your terminal and type:

git --version

If it returns a version number, Git is installed!

Initializing a Repository

To start using Git in a project folder:

git init

This creates a hidden .git folder that tracks your changes.

Making Your First Commit

git add .
git commit -m "Iniitial commit"

Cloning a Repository

You can copy an existing repo to your machine using:

git clone http://github.com/username/repo-name.git

Pushing To GitHub

After linking your local project to a GitHub repo:

git remote add origin https://github.com/username/repo.git
git push -u origin main

This upload your work to GitHub.

Basic Commands Cheat Sheet