Slide 1

Slide 1 text

GIT bildiğiniz gibi değil… lemi orhan ergin

Slide 2

Slide 2 text

GIT bildiğiniz gibi değil… LEMİ ORHAN ERGİN Agile Software Craftsman, ACM 2001’den bu yana yazılım geliştiriyor Agile Turkey topluluk lideri Software Craftsmanship Turkey kurucusu Yazılımcı, Mimar, Eğitmen, Koç, Danışman 2009’dan bu yana GitMan Sony & eBay/GittiGidiyor eski çalışanı ACM’de yönetici ortak /lemiorhan lemiorhanergin.com @lemiorhan

Slide 3

Slide 3 text

Sürüm Yönetim Sistemleri dijital dosyalar için bir zaman makinesidir

Slide 4

Slide 4 text

Sürüm Kontrol Sistemleri Merkezi Yerel Dağıtık

Slide 5

Slide 5 text

Sadece dosya isimlerini kullanarak dosyaların sürümlerini belirler YEREL Sürüm Kontrol Sistemi

Slide 6

Slide 6 text

Revision Control System revizyonları yamalar halinde (patch) bir isimlendirme kuralına uygun şekilde saklar. http://en.wikipedia.org/wiki/Revision_Control_System YEREL Sürüm Kontrol Sistemi

Slide 7

Slide 7 text

merkezİ Sürüm Kontrol Sistemi Dosyaları ortak bir alanda saklar (sunucu) ve herkes buraya kendi kişisel makinalarından erişir (istemci)

Slide 8

Slide 8 text

merkezİ Sürüm Kontrol Sistemi Kullanıcılarda dosyaların sadece son sürümleri bulunur Eğer sunucu bozulursa, tüm sürümleri kaybetme ihtimali vardır

Slide 9

Slide 9 text

Sturgeon’nun Kuralı Der ki; bir işe yaramaz Yaptığımız şeylerin %90’ı İşe yarayan çözümleri bulabilmek için deneysel çalışmalar yapabileceğimiz, korkmadan sistemi dağıtabileceğimiz, güvenilir bir sisteme ihtiyaç vardır

Slide 10

Slide 10 text

Dağıtık Sürüm Kontrol Sistemi Her iki tipin avantajlarının birleşimi bir hibrit sistemdir

Slide 11

Slide 11 text

Dağıtık Sürüm Kontrol Sistemi Sunucuya erişim sorunlarına ve sunucudaki sürümlere bağımlılıktan endişe duymadan yerel değişiklikler yapabilmenizi sağlar

Slide 12

Slide 12 text

SVN gibi dağıtık olmayan sistemler Dosya farkları şeklinde

Slide 13

Slide 13 text

Git değişiklikleri farklı tutar Değişmiş dosyalar halinde

Slide 14

Slide 14 text

2.7Gb 8.2Gb 450MB ? MOZILLA 350Mb kaynak kod İÇİN 1998’den bu yana yazılan Ne kadar bİR DİSK ALANI GEREKLİ

Slide 15

Slide 15 text

Git Ortami

Slide 16

Slide 16 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu .git Folder / Object Database

Slide 17

Slide 17 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu .git Folder / Object Database

Slide 18

Slide 18 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu .git Folder / Object Database

Slide 19

Slide 19 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu .git Folder / Object Database

Slide 20

Slide 20 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu .git Folder / Object Database

Slide 21

Slide 21 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu .git Folder / Object Database

Slide 22

Slide 22 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu .git Folder / Object Database

Slide 23

Slide 23 text

Sunucuya Kod Gönderme

Slide 24

Slide 24 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu .git Folder / Object Database

Slide 25

Slide 25 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu $ git add .git Folder / Object Database

Slide 26

Slide 26 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu $ git commit .git Folder / Object Database

Slide 27

Slide 27 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı .git Folder / Object Database Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu $ git push

Slide 28

Slide 28 text

Sunucudan Güncellemeleri Alma

Slide 29

Slide 29 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı .git Folder / Object Database Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu

Slide 30

Slide 30 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı .git Folder / Object Database Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu $ git fetch

Slide 31

Slide 31 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu $ git merge FETCH_HEAD .git Folder / Object Database

Slide 32

Slide 32 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu $ git pull KISAYOL .git Folder / Object Database

Slide 33

Slide 33 text

Kodu Sifirdan Alma

Slide 34

Slide 34 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu .git Folder / Object Database

Slide 35

Slide 35 text

Kaynak Kod Woking Copy Cache Staging Area / The Index Obje Veritabanı Uzak Depo Upstream Repo / Remote Repo Kendi makinamız Sunucu $ git clone KISAYOL .git Folder / Object Database

Slide 36

Slide 36 text

Bir Grup Kod Değişikliği: Commit

Slide 37

Slide 37 text

Kaliningrad, Prussia’daki 7 köprü Yıl 1735

Slide 38

Slide 38 text

Königsberg, Prussia’daki 7 köprü Yıl 1735 Her bir köprüden bir kez geçerek tüm şehri dolaşabilir misiniz? Leonhard Euler

Slide 39

Slide 39 text

ÇİZGE TEORİSİ (Graph Theory)

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

klasör klasör klasör dosya dosya dosya

Slide 45

Slide 45 text

klasör klasör klasör dosya dosya dosya GIT bildiğiniz gibi değil… commit $ git add . $ git commit -m “first commit”

Slide 46

Slide 46 text

klasör klasör klasör dosya dosya dosya GIT bildiğiniz gibi değil… commit branch HEAD $ git add . $ git commit -m “first commit”

Slide 47

Slide 47 text

klasör klasör klasör dosya dosya dosya GIT bildiğiniz gibi değil… commit klasör klasör klasör dosya commit branch HEAD $ git add . $ git commit -m “second commit”

Slide 48

Slide 48 text

commit commit commit klasör klasör klasör dosya dosya dosya GIT bildiğiniz gibi değil… commit klasör klasör klasör dosya commit branch HEAD klasör dosya commit $ git add . $ git commit -m “third commit”

Slide 49

Slide 49 text

GIT bildiğiniz gibi değil… branch HEAD commit commit commit $ git add . $ git commit -m “third commit”

Slide 50

Slide 50 text

d99108a master HEAD $ git commit -m "first commit" [master (root-commit) d99108a] first commit 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore

Slide 51

Slide 51 text

d99108a master HEAD a4510bc $ git commit -m "second commit" [master a4510bc] second commit 1 file changed, 1 insertion(+)

Slide 52

Slide 52 text

d99108a master HEAD a4510bc b2be58f $ git commit -m "third commit" [master b2be58f] third commit 1 file changed, 1 insertion(+)

Slide 53

Slide 53 text

d99108a a4510bc b2be58f $ git commit -m "fourth commit" [master 8810ac4] fourth commit 1 file changed, 1 insertion(+) master HEAD 8810ac4 Agh! Son commit’e bir değişiklik eklemeyi unutmuşum. Son commit’i değiştireyim. “ ”

Slide 54

Slide 54 text

d99108a a4510bc b2be58f $ git commit --amend [master 1fa3409] third commit 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 readme.txt 1fa3409 Aynı ortak ata ile ilişkili 2. bir commit oluştu master HEAD 8810ac4

Slide 55

Slide 55 text

d99108a a4510bc b2be58f 1fa3409 master HEAD 8810ac4 bb43c12 $ git commit -m "fifth commit" [master bb43c12] fifth commit 1 file changed, 1 insertion(+)

Slide 56

Slide 56 text

Ayni Anda Farkli Görevleri Gerçekleştirme

Slide 57

Slide 57 text

master HEAD

Slide 58

Slide 58 text

TAG/v1.1 $ git tag tag/v1.1 master HEAD

Slide 59

Slide 59 text

TAG/v1.1 master HEAD $ git commit

Slide 60

Slide 60 text

$ git branch typofix master HEAD typofix TAG/v1.1

Slide 61

Slide 61 text

$ git checkout typofix master typofix TAG/v1.1 HEAD

Slide 62

Slide 62 text

master HEAD typofix TAG/v1.1 $ git commit

Slide 63

Slide 63 text

master typofix TAG/v1.1 $ git checkout master HEAD

Slide 64

Slide 64 text

master HEAD TAG/v1.1 typofix $ git commit

Slide 65

Slide 65 text

master HEAD TAG/v1.1 typofix $ git merge typofix

Slide 66

Slide 66 text

master HEAD TAG/v1.1 $ git branch -d typofix

Slide 67

Slide 67 text

Kod Birleştirmenin Akillisi

Slide 68

Slide 68 text

master HEAD typofix TAG/v1.1

Slide 69

Slide 69 text

master HEAD typofix TAG/v1.1 $ git merge typofix

Slide 70

Slide 70 text

Başkalarinin Kodunu İle Entegrasyon

Slide 71

Slide 71 text

master HEAD TAG/v1.1 typofix

Slide 72

Slide 72 text

master HEAD TAG/v1.1 typofix $ git rebase master

Slide 73

Slide 73 text

Kaybolmayan Kod Sorunsali :)

Slide 74

Slide 74 text

master typofix TAG/v1.1 login HEAD

Slide 75

Slide 75 text

master TAG/v1.1 login HEAD $ git branch -D typofix

Slide 76

Slide 76 text

master typofix TAG/v1.1 login HEAD $ git branch typofix a45f3c

Slide 77

Slide 77 text

Cimbizla Kod Tirtiklamak

Slide 78

Slide 78 text

master HEAD TAG/v1.1 typofix

Slide 79

Slide 79 text

master HEAD TAG/v1.1 typofix $ git cherry-pick Green1 Green2

Slide 80

Slide 80 text

Hatalardan Geri Dönüş

Slide 81

Slide 81 text

master HEAD TAG/v1.1 typofix

Slide 82

Slide 82 text

master HEAD TAG/v1.1 typofix $ git reset HEAD~2

Slide 83

Slide 83 text

Commit Graph

Slide 84

Slide 84 text

commit branch checkout reset revert cherry-pick tag merge rebase stash fetch

Slide 85

Slide 85 text

LEMİ ORHAN ERGİN Master Software Craftsman, ACM /lemiorhan lemiorhanergin.com @lemiorhan