0Pricing
Git Advanced: Monorepo, Submodules & Workflows · درس

سير عمل التفريع للمشروعات مفتوحة المصدر

تعرّف على نموذج سير عمل التفريع، الضروري للمساهمة في المشروعات مفتوحة المصدر وإدارة المساهمات الخارجية

سير عمل التفريع للمشروعات مفتوحة المصدر درس مجاني في Git Advanced: Monorepo, Submodules & Workflows على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Git Advanced: Monorepo, Submodules & Workflows، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Git Advanced: Monorepo, Submodules & Workflows 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Intro to Forking Workflow

Welcome to the Forking Workflow! This model is super popular for open-source contributions and managing external collaborators.

It provides a structured way for anyone to contribute to a project without needing direct write access to the original repository.

What is a Fork?

A fork is essentially your own personal copy of someone else's repository. This copy lives on the Git hosting service (like GitHub or GitLab), not directly on your computer.

  • It's a server-side clone of the original project.
  • You have full write access to your fork.
  • Changes you make here don't affect the original project until you propose them.

Clone Your Fork Locally

Once you've forked a repository on the web, the next step is to get that copy onto your local machine. You'll clone your own fork, not the original project.

Use the git clone command with the URL of your forked repository:

git clone https://github.com/your-username/project-repo.git

Connect to Upstream (Original)

After cloning your fork, it's crucial to establish a connection to the original repository. We call this the 'upstream' remote.

This link allows you to fetch updates from the original project and keep your fork synchronized.

git remote add upstream https://github.com/original-owner/project-repo.git
git remote -v

Work on a New Feature Branch

Before making any changes, always create a new branch for your contribution. This keeps your changes isolated and makes it easier to manage multiple contributions or discard work if needed.

  • Switch to your main branch (e.g., main or master).
  • Pull the latest from your fork.
  • Create and switch to a new branch.
git checkout main
git pull origin main
git checkout -b my-new-feature
# ... make changes and commit ...
git add .
git commit -m "feat: Add my new feature"

Sync with Upstream Changes

Projects evolve quickly! To avoid merge conflicts and ensure your changes are based on the latest code, regularly sync your local repository with the original upstream project.

First, fetch changes from upstream, then rebase your feature branch:

git fetch upstream
git checkout my-new-feature
git rebase upstream/main

Push Changes to Your Fork

Once your changes are committed and your branch is updated, push your feature branch to your personal remote fork. This makes your work visible on your GitHub/GitLab profile.

Use git push origin <branch-name> to send your changes:

git push origin my-new-feature

Create a Pull Request (PR)

With your changes pushed to your fork, the final step is to propose them to the original project. You do this by creating a Pull Request (PR) (sometimes called a Merge Request).

  • A PR is a formal proposal to merge your changes into the upstream project.
  • It allows project maintainers to review your code, suggest changes, and discuss your contribution.
  • You'll typically initiate this from your Git hosting service's website.

Test Your Knowledge

Which of the following are key steps in the Forking Workflow when contributing to an open-source project?

Forking Workflow Summary

You've learned the essentials of the Git Forking Workflow!

  • You create a fork (your server-side copy).
  • You clone your fork locally.
  • You link to the original project as upstream.
  • You make changes on a dedicated feature branch.
  • You sync with upstream and push to your fork.
  • Finally, you create a Pull Request to propose your changes.

This workflow is fundamental for collaborative open-source development!

الأسئلة الشائعة

هل درس «سير عمل التفريع للمشروعات مفتوحة المصدر» مجاني؟

نعم — نص درس «سير عمل التفريع للمشروعات مفتوحة المصدر» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Git Advanced: Monorepo, Submodules & Workflows، انتقل إلى CoddyKit PRO. تتضمن دورة Git Advanced: Monorepo, Submodules & Workflows 4 دروس في المجموع.

ماذا ستتعلم في «سير عمل التفريع للمشروعات مفتوحة المصدر»؟

تعرّف على نموذج سير عمل التفريع، الضروري للمساهمة في المشروعات مفتوحة المصدر وإدارة المساهمات الخارجية تتمرن على Git Advanced: Monorepo, Submodules & Workflows مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Git Advanced: Monorepo, Submodules & Workflows؟

لا تُشترط خبرة سابقة. Git Advanced: Monorepo, Submodules & Workflows على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «سير عمل التفريع للمشروعات مفتوحة المصدر»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Git Advanced: Monorepo, Submodules & Workflows هذا؟

نعم. كل درس في Git Advanced: Monorepo, Submodules & Workflows يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. سير عمل التفريع للمشروعات مفتوحة المصدر
  2. إدارة الفرق والمستودعات الكبيرة
  3. أفضل ممارسات مراجعة التعليمات البرمجية
  4. إدارة المساهمات باستخدام طلبات السحب وآداب مسؤولي الصيانة
← العودة إلى Git Advanced: Monorepo, Submodules & Workflows