جيت والتعاونمتوسط
Rebase
إعادة تأسيس الفرع
النطقريبيس
التعريف
نقل commits فرعك فوق أحدث commits فرع آخر، للحصول على تاريخ نظيف ومستقيم.
أين تسمعه؟
سير عمل Git والمقابلات.
أمثلة
Rebase your branch on
اعمل rebase لفرعك علىmainbefore opening the PR.mainقبل فتح الـ PR.Never rebase a branch that others already use.
لا تعمل rebase لفرع يستخدمه آخرون.After the rebase, the feature branch sits on top of the latest main.
بعد إعادة التأسيس، صار فرع الميزة فوق أحدث نسخة من main.
خطأ شائع
عمل rebase للفروع المشتركة. هذا يعيد كتابة التاريخ ويفسد نسخ زملائك.
لا تخلطه مع
يعيد Rebase كتابة تاريخ الـ commits لإنشاء مسار خطي، بينما يحافظ merge على التاريخ الدقيق من خلال دمج الفروع بـ commit جديد.
قلها في العمل
- في اجتماع أو محادثة
Let's quickly rebase our feature branches to pick up the latest bug fixes from main.
دعنا نقوم بـ rebase لفروع الميزات الخاصة بنا بسرعة لنحصل على أحدث إصلاحات الأخطاء من main. - في بريد أو تذكرة
Please rebase your branch on top of the latest development branch and resolve any conflicts before requesting a review.
يرجى عمل rebase لفرعك فوق أحدث فرع development وحل أي تعارضات قبل طلب المراجعة.
واصل الاستكشاف
المزيد في جيت والتعاون