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
110
Review of Graph Databases
asarturas
0
52
Profiling in PHP
asarturas
5
890
Design Patterns in PHP Applications
asarturas
5
190
Application Quality
asarturas
6
300
Vagrant 1.2.2 and AWS
asarturas
0
48
Let's automate!
asarturas
0
240
AngularJS
asarturas
14
1.3k
Other Decks in Programming
See All in Programming
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
150
Tuning GraphQL on Rails
pyama86
2
1k
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.2k
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
390
僕がつくった48個のWebサービス達
yusukebe
18
17k
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
160
qmuntal/stateless のススメ
sgash708
0
120
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
230
Universal Linksの実装方法と陥りがちな罠
kaitokudou
1
220
現場で役立つモデリング 超入門
masuda220
PRO
13
2.9k
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
1.5k
Honoの来た道とこれから
yusukebe
19
3k
Featured
See All Featured
Producing Creativity
orderedlist
PRO
341
39k
Navigating Team Friction
lara
183
14k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
The Invisible Side of Design
smashingmag
297
50k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Teambox: Starting and Learning
jrom
132
8.7k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
41
2.1k
Git: the NoSQL Database
bkeepers
PRO
425
64k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
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