# 🇬🇧 09 — Branches and pull requests A branch is a safe copy of the project where you can work without disturbing `main`. A pull request is the request to bring that work back. ## When you need a branch - The change is big enough that half-finished work would break things. - Somebody should look at it before it goes live. - You want to try an idea and be able to throw it away. For a typo in a document, committing straight to `main` is fine. ## Creating a branch in the browser While committing (chapter 03), choose **Create a new branch for this commit and start a pull request**, name the branch, and commit. Good names describe the work: ``` docs/vlan-notes fix/wrong-gateway feature/report-export ``` ## Opening a pull request 1. Go to **Pull Requests → New Pull Request**. 2. Pick the source branch (yours) and the target (`main`). 3. Title = what the change does. Description = why, plus anything reviewers should check. 4. Press **Create Pull Request**. ## Review - Reviewers comment on individual lines from the **Files Changed** tab. - Push more commits to the same branch — the pull request updates itself. - When it is approved, press **Merge Pull Request**, then delete the branch. ## Merge conflicts If `main` changed the same lines you did, KabaForge asks you to resolve it. From your computer: ```bash git switch my-branch git fetch origin git merge origin/main # open the marked files, keep the correct lines git add . git commit git push ``` ## Protecting `main` **Settings → Branches → Add rule**: require pull requests and approvals before anything reaches `main`. Recommended as soon as more than one person works in the repository. --- # 🇹🇷 09 — Dallar ve değişiklik istekleri Dal, `main`'i rahatsız etmeden çalışabileceğiniz güvenli bir kopyadır. Değişiklik isteği (pull request) ise o çalışmayı geri getirme talebidir. ## Ne zaman dal gerekir - Değişiklik, yarım hâliyle işleri bozacak kadar büyükse. - Yayına girmeden önce birinin bakması gerekiyorsa. - Bir fikri deneyip gerekirse çöpe atabilmek istiyorsanız. Bir belgedeki yazım hatası için doğrudan `main`'e işlemek yeterlidir. ## Tarayıcıda dal oluşturma İşleme sırasında (bölüm 03) **Bu işleme için yeni bir dal oluşturun ve bir değişiklik isteği başlatın** seçeneğini seçin, dala ad verip işleyin. İyi adlar işi anlatır: ``` docs/vlan-notlari fix/yanlis-gateway feature/rapor-disa-aktarim ``` ## Değişiklik isteği açma 1. **Değişiklik İstekleri → Yeni Değişiklik İsteği**. 2. Kaynak dalı (sizinki) ve hedefi (`main`) seçin. 3. Başlık = değişikliğin ne yaptığı. Açıklama = nedeni ve incelemecilerin bakması gerekenler. 4. **Değişiklik İsteği Oluştur**'a basın. ## İnceleme - İncelemeciler **Değişen Dosyalar** sekmesinden tek tek satırlara yorum yazar. - Aynı dala yeni işlemeler gönderin — istek kendini günceller. - Onaylanınca **Birleştir**'e basın, ardından dalı silin. ## Birleştirme çakışmaları `main` sizinle aynı satırları değiştirdiyse KabaForge çözmenizi ister. Bilgisayarınızdan: ```bash git switch dalim git fetch origin git merge origin/main # işaretlenen dosyaları açın, doğru satırları bırakın git add . git commit git push ``` ## `main` dalını koruma **Ayarlar → Dallar → Kural ekle**: `main`'e bir şey girmeden önce değişiklik isteği ve onay şartı koyun. Depoda birden fazla kişi çalışır çalışmaz önerilir.