شبكة تعلم مع ناو

ما الأمر الذي ينشئ فرعًا جديدًا في Git؟

الأمر git branch مع اسم الفرع:

git branch new-feature

هذا ينشئ الفرع فقط، وتبقى أنت في الفرع الحالي.

إنشاء والانتقال معًا

git switch -c new-feature
# or the older way
git checkout -b new-feature

أوامر مفيدة

git branch            # list branches
git switch main       # move to another branch
git branch -d old     # delete a merged branch

لا توجد أوامر مثل git new branch أو git create branch.

اختبر نفسك

خمسة أسئلة سريعة، مع الإجابة والشرح بعد كل سؤال.