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
230
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
130
Review of Graph Databases
asarturas
0
75
Profiling in PHP
asarturas
5
910
Design Patterns in PHP Applications
asarturas
5
200
Application Quality
asarturas
6
320
Vagrant 1.2.2 and AWS
asarturas
0
60
Let's automate!
asarturas
0
260
AngularJS
asarturas
14
1.3k
Other Decks in Programming
See All in Programming
Cache Me If You Can
ryunen344
2
4k
Testing Trophyは叫ばない
toms74209200
0
890
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
710
Kiroで始めるAI-DLC
kaonash
2
630
機能追加とリーダー業務の類似性
rinchoku
2
1.3k
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
460
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
440
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.5k
アルテニア コンサル/ITエンジニア向け 採用ピッチ資料
altenir
0
110
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
570
Platformに“ちょうどいい”責務ってどこ? 関心の熱さにあわせて考える、責務分担のプラクティス
estie
1
140
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
11
4.4k
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
330
21k
Practical Orchestrator
shlominoach
190
11k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.9k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.8k
Speed Design
sergeychernyshev
32
1.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.1k
Embracing the Ebb and Flow
colly
87
4.8k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
The Cult of Friendly URLs
andyhume
79
6.6k
The World Runs on Bad Software
bkeepers
PRO
70
11k
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