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
2
220
Git Rebase
Introduction to Git Rebase by me at Inviqa Enlighening Lunch
Arturas Smorgun
August 29, 2013
Tweet
Share
More Decks by Arturas Smorgun
See All by Arturas Smorgun
Solve Complex Problems with DDD
asarturas
0
120
Review of Graph Databases
asarturas
0
73
Profiling in PHP
asarturas
5
910
Design Patterns in PHP Applications
asarturas
5
200
Application Quality
asarturas
6
310
Vagrant 1.2.2 and AWS
asarturas
0
59
Let's automate!
asarturas
0
260
AngularJS
asarturas
14
1.3k
Other Decks in Programming
See All in Programming
從零到一:搭建你的第一個 Observability 平台
blueswen
1
870
GoのWebAssembly活用パターン紹介
syumai
3
9.9k
FastMCPでMCPサーバー/クライアントを構築してみる
ttnyt8701
2
130
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
1
530
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
150
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
790
Practical Tips and Tricks for Working with Compose Multiplatform Previews (mDevCamp 2025)
stewemetal
0
120
Passkeys for Java Developers
ynojima
2
840
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfold' relates to 'iterate'"
philipschwarz
PRO
0
190
DroidKnights 2025 - 다양한 스크롤 뷰에서의 영상 재생
gaeun5744
2
120
データベースコネクションプール(DBCP)の変遷と理解
fujikawa8
1
250
無関心の谷
kanayannet
0
160
Featured
See All Featured
Being A Developer After 40
akosma
90
590k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.3k
How STYLIGHT went responsive
nonsquared
100
5.6k
Side Projects
sachag
454
42k
Statistics for Hackers
jakevdp
799
220k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
780
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
228
22k
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