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
猫と暮らす Google Nest Cam生活🐈 / WebRTC with Google Nest Cam
yutailang0119
0
120
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
800
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.5k
Hack Claude Code with Claude Code
choplin
4
2k
Discover Metal 4
rei315
2
130
ふつうの技術スタックでアート作品を作ってみる
akira888
1
820
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
250
AI時代の『改訂新版 良いコード/悪いコードで学ぶ設計入門』 / ai-good-code-bad-code
minodriven
10
3k
Node-RED を(HTTP で)つなげる MCP サーバーを作ってみた
highu
0
120
すべてのコンテキストを、 ユーザー価値に変える
applism118
3
1.3k
5つのアンチパターンから学ぶLT設計
narihara
1
170
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
650
Featured
See All Featured
Embracing the Ebb and Flow
colly
86
4.7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Faster Mobile Websites
deanohume
307
31k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
The Language of Interfaces
destraynor
158
25k
Building an army of robots
kneath
306
45k
How GitHub (no longer) Works
holman
314
140k
Raft: Consensus for Rubyists
vanstee
140
7k
Visualization
eitanlees
146
16k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
For a Future-Friendly Web
brad_frost
179
9.8k
How STYLIGHT went responsive
nonsquared
100
5.6k
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