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
210
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
66
Profiling in PHP
asarturas
5
900
Design Patterns in PHP Applications
asarturas
5
190
Application Quality
asarturas
6
310
Vagrant 1.2.2 and AWS
asarturas
0
51
Let's automate!
asarturas
0
250
AngularJS
asarturas
14
1.3k
Other Decks in Programming
See All in Programming
Djangoアプリケーション 運用のリアル 〜問題発生から可視化、最適化への道〜 #pyconshizu
kashewnuts
1
230
Compose でデザインと実装の差異を減らすための取り組み
oidy
1
300
SpringBoot3.4の構造化ログ #kanjava
irof
2
970
Linux && Docker 研修/Linux && Docker training
forrep
23
4.5k
【PHP】破壊的バージョンアップと戦った話〜決断と説得
satoshi256kbyte
0
120
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
160
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
110
Grafana Cloudとソラカメ
devoc
0
140
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
11
1.8k
iOSエンジニアから始める visionOS アプリ開発
nao_randd
3
120
Lottieアニメーションをカスタマイズしてみた
tahia910
0
120
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
340
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
400
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
How GitHub (no longer) Works
holman
313
140k
Into the Great Unknown - MozCon
thekraken
35
1.6k
Building an army of robots
kneath
302
45k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Embracing the Ebb and Flow
colly
84
4.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
Unsuck your backbone
ammeep
669
57k
Navigating Team Friction
lara
183
15k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
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