Lesson 1 / الدرس 1

The problem git solves / المشكلة التي يحلها git

Everyone invents the same bad system: a folder of files ending in -v2, -final and -final-FIXED. Git is what happens when you take that instinct seriously and build it properly.

الجميع يخترع النظام السيئ نفسه: مجلد ملفات تنتهي بـ-v2 و-final و-final-FIXED. وgit هو ما يحدث حين تأخذ تلك الغريزة على محمل الجد وتبنيها كما ينبغي.

You have done this already, whether or not you have used git. Before making a big change you copy the folder. Before deleting something you rename it rather than removing it. You keep a file you no longer need because you are not quite sure. Every one of those instincts is right, and every one of them is what a version control system does properly.

site/
site-backup/
site-backup-2/
site-final/
site-final-USE-THIS-ONE/
index-old.html
index-old-2.html
Run the demonstration to see what each of these was trying to achieve, and what git gives you instead. The folder above is not a joke about bad habits — it is a reasonable answer to a real problem, built by hand, by someone who had no better tool.

What git actually stores

Git keeps a series of snapshots of your whole project. Each one is called a commit, and each records the state of every file at that moment, who made it, when, and a message saying why. The history is a chain of these, and you can look at any point in it or go back to it.

You want toWithout gitWith git
Go back to yesterdayHope you copied the folderOne command
See what you changedCompare two files by eyegit diff
Know why a line existsAsk whoever wrote itgit log, and the message
Try a risky changeCopy the whole projectA branch
Work with someone elseEmail files and merge by handGitHub, and a pull request
Prove you did the workNothingYour commits, with dates

The last row matters more than beginners expect. A public history of your own commits is the most credible thing you can show someone who is deciding whether to hire you.

Git is not GitHub

These are two different things and the names make it worse. Git is a program on your own machine that records history; it works with no internet connection and no account anywhere. GitHub is a website that stores a copy of a git project so other people can reach it. You can use git for years without GitHub. Lessons 1 to 15 here do exactly that.

Try it live / جرّب بنفسك

Preview / المعاينة

Check yourself / اختبر نفسك

1. What is the difference between git and GitHub?

2. What does one commit record?

3. Why is committing a password serious even after you delete the file?

Your task / مهمتك

Find a real example of the problem on your own machine: a folder with copies, files ending in -old or -v2, or a download called something like report-final-2.pdf. Show it, then write a page explaining what each copy was for and which git idea would have replaced it. Finish with one time you lost work or could not remember why you changed something.

اعثر على مثال حقيقي للمشكلة على جهازك: مجلد فيه نسخ، أو ملفات تنتهي بـ-old أو -v2، أو تنزيل اسمه شيء مثل report-final-2.pdf. أظهره، ثم اكتب صفحة تشرح ما كانت وظيفة كل نسخة وأي فكرة في git كانت ستحل محلها. واختم بمرة فقدت فيها عملًا أو لم تستطع تذكّر سبب تغييرك شيئًا.

  • A real listing from your own machine قائمة حقيقية من جهازك
  • What each copy was for ما كانت وظيفة كل نسخة
  • Which git idea replaces each one أي فكرة في git تحل محل كل واحدة
  • One real story of lost or confusing work قصة حقيقية عن عمل ضاع أو أربك
How do you want to submit? / كيف تريد التسليم؟