شرح صفوف ومحتوى الفقرة
عندما تستنسخ نسختك المشتقة، يسجلها Git تلقائياً تحت اللقب origin، لكنه لا يضيف رابط المشروع الأصلي تلقائياً. ولإكمال أضلاع المثلث، نفّذ الأمر git remote add upstream <original-repo-url>.
وبمجرد إضافته، سيعرض الأمر git remote -v أربعة أسطر: سطرين للقب origin الخاص بنسختك القابلة للكتابة، وسطرين للقب upstream الخاص بالمستودع الرسمي المخصص للقراءة فقط.
Shell
git remote add upstream https://github.com/org/open-project.git
git remote -v
# origin [email protected]:your-user/open-project.git (fetch)
# origin [email protected]:your-user/open-project.git (push)
# upstream https://github.com/org/open-project.git (fetch)
# upstream https://github.com/org/open-project.git (push)