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
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 to | Without git | With git |
|---|---|---|
| Go back to yesterday | Hope you copied the folder | One command |
| See what you changed | Compare two files by eye | git diff |
| Know why a line exists | Ask whoever wrote it | git log, and the message |
| Try a risky change | Copy the whole project | A branch |
| Work with someone else | Email files and merge by hand | GitHub, and a pull request |
| Prove you did the work | Nothing | Your 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.
git status. تعلّم الأوامر أولًا — فهي واحدة على كل جهاز، بما فيه خادم عبر ssh لا وجود لمحرر فيه — واستخدم اللوحة بعد ذلك لأنها مريحة.Try it live / جرّب بنفسك
Check yourself / اختبر نفسك
1. What is the difference between git and GitHub?
Git needs no account and no internet. GitHub is one of several places you could put a copy — and the first fifteen lessons here need neither.
2. What does one commit record?
It is a snapshot with an explanation attached. The message is the part that makes the history readable a year later.
3. Why is committing a password serious even after you delete the file?
A commit is permanent by design — that is the whole point of the tool. Keeping secrets out from the start, which is lesson 9, is far easier than removing them later.
Score / النتيجة: 0 / 3
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 قصة حقيقية عن عمل ضاع أو أربك