سير عمل Git الشائعة
تعرّف على مختلف سير عمل Git لإدارة مشاريعك.
I
InSkillCoach
· دقيقة
سير عمل Git الشائعة
تعرّف على مختلف سير عمل Git لإدارة مشاريعك.
Git Flow
بنية الفروع
# Branches principales
main # Production
develop # Développement
# Branches de support
feature/* # Nouvelles fonctionnalités
release/* # Préparation des releases
hotfix/* # Corrections urgentes
سير العمل
- ميزة جديدة
# Créer une branche feature
git checkout -b feature/nouvelle-fonctionnalite develop
# Développer et commiter
git add .
git commit -m "Ajout de la nouvelle fonctionnalité"
# Fusionner dans develop
git checkout develop
git merge feature/nouvelle-fonctionnalite --no-ff
- الإصدار (Release)
# Créer une branche release
git checkout -b release/1.0.0 develop
# Préparer la release
# - Mettre à jour la version
# - Corriger les bugs
# - Mettre à jour la documentation
# Fusionner dans main et develop
git checkout main
git merge release/1.0.0 --no-ff
git tag -a v1.0.0 -m "Version 1.0.0"
git checkout develop
git merge release/1.0.0 --no-ff
GitHub Flow
بنية بسيطة
main # Production
feature/* # Fonctionnalités
سير العمل
- ميزة جديدة
# Créer une branche feature
git checkout -b feature/nouvelle-fonctionnalite
# Développer et commiter
git add .
git commit -m "Ajout de la nouvelle fonctionnalité"
# Pousser et créer une Pull Request
git push origin feature/nouvelle-fonctionnalite
- مراجعة الشيفرة (Code Review)
# Après la review, fusionner dans main
git checkout main
git merge feature/nouvelle-fonctionnalite
git push origin main
GitLab Flow
بنية مع البيئات
main # Production
staging # Staging
preprod # Pré-production
feature/* # Fonctionnalités
سير العمل
- التطوير
# Créer une branche feature
git checkout -b feature/nouvelle-fonctionnalite
# Développer et commiter
git add .
git commit -m "Ajout de la nouvelle fonctionnalité"
# Pousser et créer une Merge Request
git push origin feature/nouvelle-fonctionnalite
- خط أنابيب النشر (Pipeline)
# Après validation, fusionner dans staging
git checkout staging
git merge feature/nouvelle-fonctionnalite
# Puis dans preprod
git checkout preprod
git merge staging
# Enfin dans main
git checkout main
git merge preprod
Trunk-Based Development
بنية مبسّطة
main # Branche principale
feature/* # Fonctionnalités courtes
سير العمل
- التطوير
# Créer une branche feature courte
git checkout -b feature/petite-fonctionnalite
# Développer rapidement
git add .
git commit -m "Ajout de la fonctionnalité"
# Fusionner rapidement dans main
git checkout main
git merge feature/petite-fonctionnalite
أفضل الممارسات
-
اختيار سير العمل
- حجم الفريق
- نوع المشروع
- وتيرة الإصدارات
- متطلبات الجودة
-
إدارة الفروع
- أسماء واضحة
- عمر قصير
- تنظيف دوري
- حماية الفروع
-
عملية المراجعة
- معايير القبول
- اختبارات آلية
- التوثيق
- التواصل
الخلاصة
النقاط الأساسية التي يجب تذكّرها:
- سير عمل متنوعة وملائمة
- عمليات التعاون
- إدارة الإصدارات
- جودة الشيفرة
التوصيات:
- اختيار سير العمل المناسب
- تكييفه مع الاحتياجات
- أتمتة العمليات
- اتباع أفضل الممارسات
- التدرّب على Git
نبذة عن InSkillCoach
خبير في التدريب والتقنيات
مدرّب متخصص في التقنيات المتقدمة والذكاء الاصطناعي، تدعمه شركة GNeurone Inc.
الشهادات:
- AWS Certified Solutions Architect – Professional
- شهادات Google Cloud
- Microsoft Certified: DevOps Engineer Expert
- Certified Kubernetes Administrator (CKA)
- CompTIA Security+
709
171
التعليقات
التعليقات مدعومة عبر GitHub Discussions
سجّل الدخول باستخدام GitHub للمشاركة في النقاش