1 Haziran 2020 Pazartesi

Git Flow - Basit Değil

Git Flow
Git Flow 2010 yılında ortaya çıktı. Açıklaması şöyle
Git-flow was described by Vincent Driessen on his 2010 post A successful Git branching model.

Git Flow modeli şöyle. Ana yazılım hatları şöyle. Açıklamaları ben kendi anlayışıma göre yazdım.
1. Master - Tam bitmiş ve test edilmiş yazılım
2. Hotfix - Tam bitmiş yazılımdaki hatalar

3. Release - Örneğin 8 sprint boyunca çalışıp üretilen yazılım. Bu yazılım belli bir safhayı temsil eder. Belki bu yazılım ile test'e girilir. Test'teki hatalar burada ve master'da düzeltilir.

4. Develop - Örneğin bir Sprint'i temsil eder
5. Feature - Örneğin bir Sprint'teki her bir iş için feature açılır.
Benzer bira çıklama şöyle
The earliest and most widely used workflow. Its characteristic is that there will be two long-standing branches, namely the main branch(master) and the development branch(develop), and there will be three temporary branches, the feature branch(feature), the hotfix branch(hotfix), and the release branch(release)

The main branch master corresponds to the online version. Every time the development branch is merged into the main branch for online version, a tag will be added.

The develop branch corresponds to the development version. The development of a new version starts from the develop branch and creates a feature branch. After the feature is developed, it is merged into the develop branch. It is recommended to use the--no-offparameter when merging.

The feature branch corresponds to developing new functions, the hotfix branch corresponds to online bug fixes, and the release branch corresponds to pre-release function acceptance.
Burada önemli olan şey nihayetinde her şey gelip master'da birleşiyor ve master'da bir tag atıldıktan sonra master ilerlemeye devam ediyor.

Bu model karşılık olduğu için bazı durumlarda "GitHub Flow" da kullanılabilir.
Ne Zaman Kullanılır?
Açıklaması şöyle.
Multiple versions in production 

If your code is having multiple versions in production (i.e. typical software products like Operating Systems, Office Packages, Custom applications, etc) you may use git-flow. Main reason is that you need to continuously support previous versions in production while developing the next version.
İki tane önemli branch var
1. Develop
2. Master

3 tane destekleyici branch var
1. Feature
2. Release
3. Hotfix

Develop Branch Nedir?
Açıklaması şöyle. Kodun en son hali hali gibi düşünülebilir.
... the develop branch is similar to the master branch most of the time. The develop branch always stores the most recent unreleased version. After the code on the develop branch is verified and can be released, you can create a release branch from the develop branch for release.
Master Branch Nedir?
Diyelim ki ben ürünü bitirdim ve sürüm 2.0 ile kabul testine girdim. Müşteri hata buldu bunları 2.0.1 hotfix branch'te düzeltir ve test ederim. Aynı düzeltmeyi geliştirmenin devam ettiği Develop branch'e de yaparım.

Depoların Anlamları Şöyle
1. origin
Uzak depo anlamına gelir.

2. origin/master - Tam Çalışan Sürümler
Uzak depodaki master dalı anlamına gelir. Test edilmiş tam çalışan sürümler için kullanılır. Örneğin Sürüm 1.0. Açıklaması şöyle
Git ile yapılan her bir proje dallarda (branch) tutulur. Aksini belirtmedikçe master adlı bir dal(branch) oluşturulur ve bunun üzerinde geliştirmeye , çalışmaya başlarsınız.
origin/master'a direkt push yapılamaz. Sadece code review  (kod gözden geçirmesi) yapılmış merge isteği yapılabilir. Açıklaması şöyle
Protect the master branch entirely from direct pushes to it. Any change that is allowed to be pushed to master must arrive via merge request.
3 master
Yerel depodaki master dalım anlamına gelir.

4. origin/develop 
Uzak depodaki develop dalı anlamına gelir. Sürüm 1.0 bittikten sonra Sürüm 2.0 için çalışırken bu branch üzerinde çalışırız. Geliştiriciler direkt develop üzerinde çalışmak yerine kendi branch'leri üzerinde geliştirme yapıp hazır olunca develop ile birleştirirler.

4. HEAD
Şu anki branch'in en son hali diye düşünülebilir.

Develop İle Çalışırken İzlenen Adımlar
Açıklaması şöyle.
1. Clone
2. git switch develop
3. git switch -c feature_branch
4. Commit stuff
5. git push -u origin feature_branch
6. Create a pull request into develop on Gitlab
7. Pull develop before starting a new feature
Diğer
Git UnifiedFlow farklı bir seçenek sunuyor. Bu kullanımda da şu branch isimleri var
main
hotfix

release
develop
bugfix
feature

Hiç yorum yok:

Yorum Gönder