Git Tutorial menu

Git Tutorial

Git is a version control system. It saves snapshots of your project, so you can see what changed, go back to an older version, and work with other people without overwriting each other's work.

GitHub is a website that stores Git projects online. Together, Git and GitHub are used by almost every software company in the world.

Why Learn Git?

  • Never lose work again: every saved version can be brought back
  • Try new ideas on a branch without breaking the working code
  • Work with a team on the same project at the same time
  • Your GitHub profile works as a portfolio for jobs and freelancing clients
  • Hosting services like Vercel and Netlify deploy straight from GitHub

What You Will Learn

  • Installing and setting up Git
  • Creating a repository and making commits
  • Viewing history and comparing changes
  • Undoing mistakes safely
  • Branches and merging, including conflicts
  • GitHub: remotes, push, pull and clone
  • Pull requests and teamwork
  • .gitignore, stash, tags and good habits

A First Example

Example

bash
git init
git add index.html
git commit -m "Add home page"
Output
Initialized empty Git repository in /home/ali/my-site/.git/
[main (root-commit) 3f2a9c1] Add home page
 1 file changed, 12 insertions(+)
 create mode 100644 index.html

Three commands, and the first version of your project is saved.

Exercises and Quiz

Each lesson ends with an exercise, and the last lesson is a quiz.

Exercise

What is Git?

Git works with any kind of project: HTML websites, Python scripts, PHP or Django apps. See the Tools tutorial for VS Code, the terminal and hosting services that work well with Git.

Want to learn with a teacher? The Workownix Full Stack Web Development course uses Git and GitHub in every project, online or at our institute in Orangi Town, Karachi.

Learn Git with a teacher

Join the Full Stack Development course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp