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
68
Profiling in PHP
asarturas
5
900
Design Patterns in PHP Applications
asarturas
5
200
Application Quality
asarturas
6
310
Vagrant 1.2.2 and AWS
asarturas
0
54
Let's automate!
asarturas
0
250
AngularJS
asarturas
14
1.3k
Other Decks in Programming
See All in Programming
Devin入門と最近のアップデートから見るDevinの進化 / Introduction to Devin and the Evolution of Devin as Seen in Recent Update
rkaga
8
4k
PsySHから紐解くREPLの仕組み
muno92
PRO
1
530
The Weight of Data: Rethinking Cloud-Native Systems for the Age of AI
hollycummins
0
190
Develop Faster With FrankenPHP
dunglas
2
2.8k
20250326_生成AIによる_レビュー承認システムの実現.pdf
takahiromatsui
17
6k
国漢文混用体からHolloまで
minhee
1
120
SLI/SLOの設定を進めるその前に アラート品質の改善に取り組んだ話
tanden
2
760
小さく段階的リリースすることで深夜メンテを回避する
mkmk884
2
140
PHPUnit 高速化テクニック / PHPUnit Speedup Techniques
pinkumohikan
1
1.3k
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
170
Kubernetesで実現できるPlatform Engineering の現在地
nwiizo
3
1.8k
リアクティブシステムの変遷から理解するalien-signals / Learning alien-signals from the evolution of reactive systems
yamanoku
2
1.1k
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.4k
Being A Developer After 40
akosma
90
590k
Designing Experiences People Love
moore
141
23k
Statistics for Hackers
jakevdp
798
220k
Designing for humans not robots
tammielis
251
25k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.6k
Faster Mobile Websites
deanohume
306
31k
Into the Great Unknown - MozCon
thekraken
36
1.7k
Optimizing for Happiness
mojombo
377
70k
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