# Conflict - Rebase

2 farklı branch de, aynı dosyada, aynı satırda yapılan değişiklikler merge edildiğinde, conflict oluşur.

```
git commit -am "file.txt eklendi" # git add yapmadan, aynı komut ile hem staged
hem de commit atabiliriz.
```

### Rebase

![](/files/s2lr8jNrHeO6fl738Dql)

Git 'de merge ve rebase komutları benzer işlevleri yerine getirmek için kullanılıyor. Her komut da bir branch 'deki değişiklikleri başka bir branch 'e birleştirmek için kullanılır. Ancak iki komut arasında proje tarihçesi oluşturulması ile ilgili ciddi bir farklılık vardır.

* Merge komutu ile A branch 'indeki değişiklikler, B branch 'i ile birleştiğinde, B branch 'inin commit tarihçesinde, merge işleminden kaynaklanan ve merge commit adı verilen otomatik oluşturulmuş bir commit yer alır. Bu commit A ve B branch 'i tarihçelerini birbiriyle ilişkilendirir.
* Rebase kullandığımızda, A branch'inin her bir commit B branch'ine sanki commit işlemi B branch'inde yapılmış gibi davranır. (yeniden yazılır)
* Bu sayede, B branch 'inin, commit tarihçesi, sanki tüm değişiklikler bu branch 'de yapılmış gibi, düz ve kesintisidir.

Birleştirilecek branch içerisinde rebase işlemi yapılmalı.

Master branch 'ine geçip,

```
git rebase test # Test branch'ini master branch ile birleştiriyor.
```

![](/files/N1ofiZabvTiv9tnGiAZP)


---

# 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/conflict-rebase.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.
