Course / دورة
Git and GitHubGit وGitHub
Save your work properly, and share it: commit, branch, merge, pull request
احفظ عملك كما ينبغي وشاركه: commit وbranch وmerge وpull request
beginner 23 lessons 6 chapters 12 hours
Before you start / قبل أن تبدأ: The operating system and the Terminal
0 / 23 lessons completed / دروس مكتملة
What you will be able to do / ماذا ستستطيع أن تفعل
- Keep a history of your work you can go back through تحتفظ بتاريخ لعملك يمكنك الرجوع فيه
- Work on a branch and merge it, including through a conflict تعمل على فرع وتدمجه، حتى مع وجود تعارض
- Publish a project to GitHub and keep it up to date تنشر مشروعًا على GitHub وتبقيه محدّثًا
- Open, review and merge a pull request تفتح وتراجع وتدمج pull request
1 Getting startedالبداية 3
-
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 هو ما يحدث حين تأخذ تلك الغريزة على محمل الجد وتبنيها كما ينبغي.
-
2
Installing git, and telling it who you are / تثبيت git وتعريفه بمن أنت
Two commands to check it is there, and three to configure it. The name and email you set here are stamped on every commit you will ever make, so it is worth getting right the first time.
أمران للتحقق من وجوده، وثلاثة لضبطه. والاسم والبريد اللذان تضبطهما هنا مختومان على كل commit ستصنعها، فيستحقان الضبط الصحيح من أول مرة.
-
3
A repository: git init, and what .git is / المستودع: git init وما هو .git
Turning a folder into a project git tracks takes one command and adds one hidden directory. Knowing what is inside that directory is what makes everything afterwards stop feeling like magic.
تحويل مجلد إلى مشروع يتتبعه git يحتاج أمرًا واحدًا ويضيف مجلدًا مخفيًا واحدًا. ومعرفة ما داخل ذلك المجلد هي ما يجعل كل ما بعده يكفّ عن الشعور بالسحر.
2 Saving your workحفظ عملك 7
-
4
The three places a file can be / المواضع الثلاثة التي قد يكون فيها الملف
Almost every confusing thing about git comes from not knowing this. A file is in your folder, or staged, or committed — and each command moves it between exactly two of those.
كل ما يحيّر في git تقريبًا يأتي من عدم معرفة هذا. فالملف إما في مجلدك، أو مجهَّز، أو مودَع — وكل أمر ينقله بين اثنين منها بالضبط.
-
5
git status: the command you run most / git status: الأمر الذي تنفّذه أكثر
It tells you where you are, what has changed, what is staged and what git suggests you do next. Run it constantly — it is free, it changes nothing, and it prevents most beginner mistakes.
يخبرك أين أنت، وما الذي تغيّر، وما المجهَّز، وبم يقترح git أن تفعل بعدها. نفّذه باستمرار — فهو مجاني ولا يغيّر شيئًا ويمنع معظم أخطاء المبتدئين.
-
6
git add: choosing what goes in / git add: اختيار ما يدخل
One command moves a change from your folder into the staging area. The interesting part is not the command — it is deciding what belongs together in one commit.
أمر واحد ينقل تغييرًا من مجلدك إلى منطقة التجهيز. والجزء المثير ليس الأمر — بل تقرير ما الذي ينتمي معًا في commit واحدة.
-
7
git commit, and a message worth reading / git commit ورسالة تستحق القراءة
The command is short. The message is the part that matters, because it is the only thing explaining why — and in six months you will be the stranger reading it.
الأمر قصير. والرسالة هي الجزء المهم، لأنها الشيء الوحيد الذي يشرح لماذا — وبعد ستة أشهر ستكون أنت الغريب الذي يقرؤها.
-
8
git log: reading your own history / git log: قراءة تاريخك
The history is only useful if you can search it. One command shows it, and a handful of options turn it into an answer to "when did this break, and who changed it?"
التاريخ لا ينفع إلا إن استطعت البحث فيه. وأمر واحد يعرضه، وحفنة خيارات تحوّله إلى جواب لسؤال "متى انكسر هذا، ومن غيّره؟"
-
9
.gitignore: what must never be committed / .gitignore: ما يجب ألا يُودَع أبدًا
Some files should never enter the history: passwords, generated output, and other people's code. One file lists them, and getting it right before the first commit saves a great deal of pain.
بعض الملفات يجب ألا تدخل التاريخ أبدًا: كلمات المرور، والمخرَجات المولَّدة، وشيفرة الآخرين. وملف واحد يعدّدها، وضبطه قبل أول commit يوفّر ألمًا كثيرًا.
-
10
Undoing: restore, reset and revert / التراجع: restore وreset وrevert
Three commands with similar names that do very different things. Choosing between them is entirely a question of which of the three places you are undoing, and whether anyone else has seen it.
ثلاثة أوامر بأسماء متشابهة تفعل أشياء شديدة الاختلاف. والاختيار بينها كله سؤال عن أي المواضع الثلاثة تتراجع عنه، وهل رآه أحد غيرك.
3 Branchesالفروع 5
-
11
What a branch actually is / ما هو الـbranch فعلًا
People imagine a branch is a copy of the project. It is not — it is a sticky note with a commit written on it, and knowing that makes everything about branching straightforward.
يتخيل الناس أن الـbranch نسخة من المشروع. وليس كذلك — بل ورقة لاصقة مكتوب عليها commit، ومعرفة ذلك تجعل كل ما يخص التفريع بسيطًا.
-
12
Creating and switching branches / إنشاء الـbranches والتبديل بينها
Two commands, and one surprise: switching branches changes the files in your folder. Your editor will show different content, and nothing is lost.
أمران، ومفاجأة واحدة: التبديل بين branches يغيّر الملفات في مجلدك. فسيعرض محررك محتوى مختلفًا، ولا شيء يضيع.
-
13
Working on a branch, and why you would / العمل على branch، ولماذا تفعل ذلك
You know how to make one. This is the part nobody explains: what branches are actually for, and the small set of habits that make them useful rather than a filing system you fight with.
تعرف كيف تصنع واحدة. وهذا هو الجزء الذي لا يشرحه أحد: ما وظيفة الـbranches فعلًا، والمجموعة الصغيرة من العادات التي تجعلها نافعة لا نظام حفظ تصارعه.
-
14
git merge: bringing the work back / git merge: إعادة العمل
Merging joins a branch back into another. It happens in one of two ways depending on whether the other branch moved while you were away — and knowing which you are getting explains the output.
الدمج يصل branch بأخرى. ويحدث بإحدى طريقتين بحسب هل تحركت الأخرى وأنت غائب — ومعرفة أيهما ستحصل عليها تفسّر المخرَج.
-
15
Merge conflicts: reading them and fixing them / تعارضات الدمج: قراءتها وإصلاحها
A conflict is not an error and nothing is broken. It is git saying two people changed the same lines and it will not guess which is right — so it hands the decision to you.
التعارض ليس خطأً ولا شيء معطل. بل هو git يقول إن شخصين غيّرا الأسطر نفسها ولن يخمّن أيهما صحيح — فيسلّم القرار إليك.
4 GitHubGitHub 3
-
16
What GitHub is, and what it is not / ما هو GitHub وما ليس هو
Fifteen lessons with no internet connection. GitHub adds one thing — a copy of your repository that other machines can reach — and then a great deal built on top of that one thing.
خمسة عشر درسًا بلا اتصال بالإنترنت. ويضيف GitHub شيئًا واحدًا — نسخة من مستودعك تستطيع أجهزة أخرى بلوغها — ثم الكثير مبنيًا فوق ذلك الشيء الواحد.
-
17
Authentication: proving it is you / المصادقة: إثبات أنك أنت
GitHub will not take your password on the command line, and that surprises people. There are two accepted ways to prove who you are, and one of them you already set up in the terminal course.
لن يقبل GitHub كلمة مرورك في سطر الأوامر، وهذا يفاجئ الناس. وثمة طريقتان مقبولتان لإثبات من أنت، وإحداهما جهّزتها بالفعل في دورة الطرفية.
-
18
clone, push and pull / clone وpush وpull
Three commands move commits between your machine and the remote. They are the whole of working with GitHub — everything else on the site is built on top of these.
ثلاثة أوامر تنقل الـcommits بين جهازك والـremote. وهي كل العمل مع GitHub — وكل ما عداها في الموقع مبني فوقها.
5 Working with othersالعمل مع الآخرين 4
-
19
The pull request / الـpull request
A pull request is a branch, proposed. It says "here is some work, please look at it before it becomes part of the project" — and it is how essentially all professional software is written.
الـpull request هو branch مقترحة. تقول "هذا عمل، فانظر فيه قبل أن يصير جزءًا من المشروع" — وهكذا تُكتب كل البرمجيات الاحترافية تقريبًا.
-
20
Reviewing a pull request, and merging it / مراجعة الـpull request ودمجه
The other half of the workflow: reading someone else's change, saying something useful about it, and pressing the button. Reviewing well is a skill, and it is mostly about how you write.
النصف الآخر من سير العمل: قراءة تغيير شخص آخر، وقول شيء نافع عنه، وضغط الزر. والمراجعة الجيدة مهارة، وهي في معظمها عن كيف تكتب.
-
21
Forks: contributing to work that is not yours / الـforks: الإسهام في عمل ليس لك
You cannot push to a repository you do not have write access to — which is almost all of them. A fork is your own copy on GitHub, and it is how every outside contribution is made.
لا تستطيع الدفع إلى مستودع لا تملك حق الكتابة فيه — وهي كلها تقريبًا. والـfork نسختك أنت على GitHub، وبه يُقدَّم كل إسهام خارجي.
-
22
A workflow, and the recovery cheatsheet / سير عمل، وبطاقة الإنقاذ
Twenty-one lessons of individual commands, assembled into the small loop you will actually run every day — and one table for the moments when something has gone wrong.
واحد وعشرون درسًا من أوامر مفردة، مجمَّعة في الحلقة الصغيرة التي ستنفّذها كل يوم فعلًا — وجدول واحد للحظات التي يسوء فيها شيء.