Branch

الفرع (Branch)

GLS-000146

Beginnerengineering1 min read
git branchfeature branchcode branchmain branchmaster branch

Definition

An isolated copy of the codebase where you can make changes without affecting the main code.

نسخة معزولة من قاعدة الكود حيث يمكنك إجراء تغييرات دون التأثير على الكود الرئيسي.

Why It Matters

Branches prevent half-finished features from breaking production. A team of 3 developers can work on 3 separate features simultaneously using branches.

الفروع تمنع الميزات غير المكتملة من كسر الإنتاج. فريق من 3 مطوّرين يمكنه العمل على 3 ميزات منفصلة في وقت واحد باستخدام الفروع.

Full Definition

A git branch is a parallel version of the repository. You create a branch to develop a feature, fix a bug, or experiment — without touching the main (production) code. When the work is done, the branch is merged back into main. In 404Fault, all Sprint work happens on the master branch directly (single developer), but teams use feature branches to isolate work.
فرع git هو نسخة موازية من المستودع. تُنشئ فرعًا لتطوير ميزة أو إصلاح خطأ أو تجريب — دون لمس الكود الرئيسي (الإنتاج). عند اكتمال العمل، يُدمَج الفرع مجددًا في main. في 404Fault، يحدث كل عمل Sprint مباشرةً على الفرع الرئيسي (مطوّر واحد)، لكن الفرق تستخدم فروع الميزات لعزل العمل.

Example Usage

git checkout -b feature/knowledge-graph creates a new branch for Sprint 4. All Knowledge Graph changes stay isolated until merged to main.

git checkout -b feature/knowledge-graph يُنشئ فرعًا جديدًا لـ Sprint 4. تبقى جميع تغييرات Knowledge Graph معزولة حتى يُدمَج في main.

Knowledge Graph

Avoid these mistakes when using Branch:

1

Long-lived branches that diverge too far from main (painful to merge)

2

Not naming branches descriptively (branch called 'fix' tells you nothing)

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using Branch.

Explain:
1. What is Branch and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Long-lived branches that diverge too far from main (painful to merge), Not naming branches descriptively (branch called 'fix' tells you nothing)
5. Best practices and production tips

Official Resources