# Branch

* Branch'ler projemize dallara ayırmamızı sağlar.

Misal, Projemize yeni bir özellik eklemek istiyoruz. Ama projenin yaşamaması, yeni özelliği bu projeyi etkilememesini istiyoruz. Ama bu özelliği de test etmek istiyoruz. Gibi durumlarda kullanabilir. Projemizin bütünlüğünü bozmadan değişiklikler yapmak istersek. Branch bu konuda bize yardımcı olacaktır.

git init komutunu verdiğimizde bizim için master adında branch oluşuyor. Eğer biz ayarlarımızda bir değişiklik yapmazsak, bütün geliştirmeyi master branch üzerinde yapıyoruz. Geliştirmeler farklı bir branch üzerinde yapılır, bir problem olmazsa master branch ile merge edilebilir (birleştirir)

{% hint style="info" %}
Bir branch içerisinde, farklı branch 'ler oluşturulabilir.
{% endhint %}

<mark style="color:red;">Bir branch oluşturduğumuzda mevcut projemizin, en son halini bu branch 'e kopyalanır.</mark>

```
git branch -l # Var olan branch listesini gösterir.
git branch database # Database branch oluşturur.
git checkout -b web # Web branch yoksa oluşturur, mevcutsa o branch 'e geçer.
git checkout [branch adı] # Belirttiğimiz branch 'e geçeriz.
```

{% hint style="info" %}
Üzerinde bulunduğumuz branch 'deki en son alınan commit 'e head denir.
{% endhint %}

![Example branch](/files/FeAUEXwvgf3icHcItYcU)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://note.onurbolatoglu.com/git-and-github/branch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
