Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Git merge-base
Search
Harri Kirik
September 02, 2019
How-to & DIY
1
70
Git merge-base
How git merge-base is awesome and can help you out in difficult situations.
Harri Kirik
September 02, 2019
Tweet
Share
More Decks by Harri Kirik
See All by Harri Kirik
Secure programming techniques: Mobile Development Security guest lecture
harri35
0
79
Support for HSM-like capabilities in Android
harri35
0
130
Why doesn't my in-app QR code work (on location)?
harri35
0
28
Smoke testing your library
harri35
0
25
Collections in Kotlin
harri35
0
33
Data classes in Kotlin
harri35
0
31
How to do delegation in Kotlin
harri35
0
32
Two-factor authentication at GDG Riga
harri35
0
71
Two-factor authentication at GDG Tartu
harri35
0
53
Other Decks in How-to & DIY
See All in How-to & DIY
【加筆修正版】ハードワークを支えるフィジカルとメンタルを構築る#rubymusclemixin 活動 #きのこ2025 #きのこ2025_b
bash0c7
0
220
エンジニアになって2年間で学んだこと
kaiphoenix
0
190
Nutanix Community Edition 超入門 25.04
ricefield66
0
150
雑にコミュニティを続けてもいいと思っている/Feel free to continue the community
camel_404
0
220
AWSコミュニティプログラムとJAWS-UGアップデート / JAWS-UG函館 勉強会 vol.14
awsjcpm
2
140
3ヶ月でできる! 探査機自作ゼミ教材自作入門
sksat
6
2.9k
JAWS-UG/AWSコミュニティ -JAWS-UGくまもと#16
awsjcpm
1
130
苦いビールを避ける冴えたやり方
watany
2
430
QFHアンテナを作ってみた、 それとパッチアンテナ
takurx
1
160
Terra Charge|普通充電器ご利用ガイドブック / Terra Charge Ordinary Charger Guidebook
contents
1
350
ジャンカーよ、車も買え ~10分でわかる!? 中古車選び入門~
arkw
1
140
家具家電付アパートの自室の冷蔵庫をスマートIoT化してみた!
scbc1167
0
120
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Making the Leap to Tech Lead
cromwellryan
134
9.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
GraphQLとの向き合い方2022年版
quramy
49
14k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.4k
Optimizing for Happiness
mojombo
379
70k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Gamification - CAS2011
davidbonilla
81
5.4k
Transcript
DEMODAY git merge-base dive deeper Location, DD/MM/YYYY Name Surname, job
title Title of the talk Git merge-base September 2nd, 2019 YOU SHOULD UNDERSTAND AND USE
DEMODAY git merge-base git merge-base finds the best common ancestor
between two commits to use in a three-way merge. 02
DEMODAY git merge-base Ancestor is a parent or a parent
of a parent (grandparent) or a great-grandparent, or a great-great-grandparent and so forth 03
DEMODAY git merge-base One common ancestor X is better than
another common ancestor Y if Y is an ancestor of X. 04
DEMODAY git merge-base A common ancestor that does not have
any better common ancestor is a best common ancestor, i.e. a merge base. 05
DEMODAY git merge base Example HERE YOU GO, HAVE AN
06
DEMODAY git merge-base “git merge-base A B” is 1: 07
o---o---o---B / ---2---1---o---o---o---A
DEMODAY git merge-base More than two commits as an argument?
A B C ? 08
DEMODAY git merge-base Then the first commit (A) is the
first argument, other commits (B C) will be merged* to create a second argument. 09
DEMODAY git merge-base “git merge-base A B C” is 1:
010 o----o----o----o----C / o----o----o----B / / ---2----1----o----o----o----A
DEMODAY git merge-base 02 Is awesome! GIT MERGE-BASE
DEMODAY git merge-base 02 Is useful! GIT MERGE-BASE
DEMODAY git merge-base For developing a fix to a release
and dev branches at the same time. 013
DEMODAY git merge base Something has gone wrong with the
release We need to fix it fast! IMAGINE THAT 014
DEMODAY git merge-base 1. ASAP: Fix the release 2. Merge
the fix to dev so development can continue 015
DEMODAY git merge-base 016 o---release-x / ---o---o---o---o---o---dev
DEMODAY git merge-base 1. Create a fix branch at a
merge base > git checkout -b fix-x $(git merge-base develop release-x) 017
DEMODAY git merge-base 018 o---release-x / ---o---o---o---o---o---dev | fix-x
DEMODAY git merge-base 2. Fix the in fix-x branch 3.
At release-x merge in the fix > git merge fix-x 4. Create and release another binary 5. At dev merge in the fix > git merge fix-x 019
DEMODAY git merge-base One fix! 020
DEMODAY git merge-base Merged into two diverged branches! 021
DEMODAY git merge-base Did not get any merge conflicts! 022
DEMODAY git merge-base Everything would still be fine even if
these branches would be merged between themselves. 023
DEMODAY git merge-base Because this is the same commit on
both branches. 024
DEMODAY git merge-base PS: Avoid cherry-picking like the plague! It
makes magic happen. When you least expect it .. 025
DEMODAY git merge-base 02 Is awesome! GIT MERGE-BASE
DEMODAY git merge base Something? OK, COOL.. DID I FORGET
027
DEMODAY git merge-base 028 git merge-base finds best common ancestor(s)
between two commits to use in a three-way merge.
DEMODAY git merge base Bonus content SOME 029
DEMODAY git merge-base 030 How does Git know to merge
changes?
DEMODAY git merge-base 031 .. amount = 15; .. ..
amount = 3; .. File A File B
DEMODAY git merge-base 032 .. amount = 15; .. ..
amount = 3; .. File A File B .. amount = 3; .. Common ancestor
DEMODAY git merge-base Questions, comments, Git stories .. THANKS! September
2nd, 2019