التعاون
Type: Learn
Languages: --
Prerequisites: Phase 0, Lesson 01
Time: ~30 minutes
أهداف التعلم
- قم بتهيئة هوية git واستخدام سير العمل اليومي لإضافة، إلتزام، ودفع
- إنشاء ودمج فروع للتجارب المعزولة دون كسر الرأس
- اكتب
.gitignoreلا تستثني نقاط التفتيش النموذجية والملفات الثنائية الكبيرة - التنقل في تاريخ الإجراءات مع
git logلفهم تطور المشروع
المشكلة
أنت على وشك كتابة مئات ملفات رمزية عبر 20 مرحلة بدون التحكم في النسخة ستفقد العمل وتكسر الأشياء التي لا تستطيع إعادة إصلاحها،
غيت هي الأداة. غيت هوب هو حيث يعيش البرمجة. هذا الدروس يغطي ما تحتاجه لهذا الدورة ولا شيء آخر.
المفهوم
sequenceDiagram
participant WD as Working Directory
participant SA as Staging Area
participant LR as Local Repo
participant R as Remote (GitHub)
WD->>SA: git add
SA->>LR: git commit
LR->>R: git push
R->>LR: git fetch
LR->>WD: git pullثلاثة أشياء يجب أن نتذكرها:
- إدخار في كثير من الأحيان (
git commit) - اضغط على جهاز التحكم عن بعد (
git push) - فرع التجارب (
git checkout -b experiment)
بناءها
الخطوة 1: إعداد git
bashgit config --global user.name "Your Name"
git config --global user.email "you@example.com"الخطوة الثانية: سير العمل اليومي
bashgit status
git add file.py
git commit -m "Add perceptron implementation"
git push origin mainالخطوة الثالثة: التفرع للتجارب
bashgit checkout -b experiment/new-optimizer
# ... make changes, commit ...
git checkout main
git merge experiment/new-optimizerالخطوة الرابعة: العمل مع هذا الدورة الإستثمارية
لا يمكنك دفع إلى إعادة التطبيق في نفس الدورة فقط الحافظين لديهم إمكانية الوصول إلى الكتابة. فوكه على GitHub أولا (حافظة الزر، أعلى اليمين) لذلك originالنصوص الخاصة بك:
bashgit clone https://github.com/YOUR-USERNAME/ai-engineering-from-scratch.git
cd ai-engineering-from-scratch
git checkout -b my-progress
# work through lessons, commit your code
git push origin my-progressاستخدمها
لهذا المسار، تحتاج بالضبط إلى هذه الأوامر:
| Command | When |
|---|---|
git clone | Get the course repo |
git add + git commit | Save your work |
git push | Back it up to GitHub |
git checkout -b | Try something without breaking main |
git log --oneline | See what you've done |
هذا كل شيء، لا تحتاج إلى إعادة التأثير أو إعادة التأهيل أو وحدات فرعية لهذا الدورة
التمارين
- إزداد هذا الإستعراض، قم بتخصيص الشوكة، وإنشاء فرع يدعى
my-progress, إصنع ملفاً , إلتزامها , إدفعها - إخلق
.gitignoreالتي تستبعد ملفات النموذجية لمواقع التفتيش (.pt،.pth،.safetensors) - انظر تاريخ التزامات هذا الإنتقال مع
git log --onelineوقرأ كيف تم إضافة الدروس
الشروط الرئيسية
| Term | What people say | What it actually means |
|---|---|---|
| Commit | "Saving" | A snapshot of your entire project at a point in time |
| Branch | "A copy" | A pointer to a commit that moves forward as you work |
| Merge | "Combining code" | Taking changes from one branch and applying them to another |
| Remote | "The cloud" | A copy of your repo hosted somewhere else (GitHub, GitLab) |
This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.
Browse the complete course catalog or open this lesson on GitHub.