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 Rebase
Search
Arturas Smorgun
August 29, 2013
Programming
240
2
Share
Git Rebase
Introduction to Git Rebase by me at Inviqa Enlighening Lunch
Arturas Smorgun
August 29, 2013
More Decks by Arturas Smorgun
See All by Arturas Smorgun
Solve Complex Problems with DDD
asarturas
0
150
Review of Graph Databases
asarturas
0
94
Profiling in PHP
asarturas
5
940
Design Patterns in PHP Applications
asarturas
5
220
Application Quality
asarturas
6
340
Vagrant 1.2.2 and AWS
asarturas
0
79
Let's automate!
asarturas
0
280
AngularJS
asarturas
13
1.3k
Other Decks in Programming
See All in Programming
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
200
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
2
370
GoogleCloudとterraform完全に理解した
terisuke
1
110
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
290
Server-Side Kotlin LT大会 vol.18 [Kotlin-lspの最新情報と Neovimのlsp設定例]
yasunori0418
1
160
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
490
ドメインイベントでビジネスロジックを解きほぐす #phpcon_odawara
kajitack
3
790
Swift Concurrency Type System
inamiy
0
540
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
380
感情を設計する
ichimichi
5
1.5k
Liberating Ruby's Parser from Lexer Hacks
ydah
2
1.5k
アーキテクチャモダナイゼーションとは何か
nwiizo
19
5.3k
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Prompt Engineering for Job Search
mfonobong
0
270
Visualization
eitanlees
150
17k
Unsuck your backbone
ammeep
672
58k
Building Applications with DynamoDB
mza
96
7k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Paper Plane
katiecoart
PRO
1
49k
Rails Girls Zürich Keynote
gr2m
96
14k
Agile that works and the tools we love
rasmusluckow
331
21k
Transcript
git rebase by Arturas Smorgun, Inviqa Enlightening Lunch
• Git Internal Data Structures; • Interactive Rebase; • Basic
Rebase; • Less Basic Rebase; • Use Case. Contents
Git Internals Data structures
• Content-addressable filesystem; • Insert content -- get key back;
• You can add to graph, but not edit or remove. Git
• blob -- file contents • tree -- directory layouts
and filenames • commit -- forms git commit graph • tag -- annotated tag Objects
References • Pointer to an object: • branch • remote
branch • lightweight tag
Symbolic references • Pointer to another pointer: • HEAD
Interactive Rebase
$ git rebase -i HEAD~3
Interactive • Remove or rearrange commits; • Edit commit messages;
• Amend commits; • Squash several commits; • Run shell commands.
--autosquash • Used in interactive rebase; • Commits starting with
“squash! “ will be automatically marked to squash.
Basic Rebase
$ git rebase <newbase> <newbase> - branch, to which rebasing;
git rebase • Forward-port local commits to the updated upstream
head (from manual); • One of the ways to integrate changes from one branch to another (from the internets).
How it works? • Go to common ancestor; • get
diff by each commit of current branch; • save diffs to temporary files; • reset current branch to same commit as branch you rebasing onto; • apply each change in turn.
^ say we have this
^ $ git rebase master
Less Basic Rebase
$ git rebase --onto <newbase> <base> <tip> <newbase> -- branch,
to which rebasing; <next> -- ancestor of rebase branch; <topic> -- tip of rebase branch;
^ say we have this
^ after rebase --onto
Final Note (instead of conclusion)
Do not rebase commits that you have pushed to a
public repository.
Questions?
Thank you! See Inviqa Training “Git Beyond the Basics” by
Alistair Stead and “Pro Git” ebook at http://git-scm.com/book by Scot Chacon