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
65
Profiling in PHP
asarturas
5
890
Design Patterns in PHP Applications
asarturas
5
190
Application Quality
asarturas
6
310
Vagrant 1.2.2 and AWS
asarturas
0
50
Let's automate!
asarturas
0
240
AngularJS
asarturas
14
1.3k
Other Decks in Programming
See All in Programming
テストコード書いてみませんか?
onopon
2
340
ESLintプラグインを使用してCDKのセオリーを適用する
yamanashi_ren01
2
240
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
590
Azure AI Foundryのご紹介
qt_luigi
1
210
AHC041解説
terryu16
0
400
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
最近のVS Codeで気になるニュース 2025/01
74th
1
100
Package Traits
ikesyo
1
210
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
550
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
28
4.2k
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
180
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
51
7.3k
Producing Creativity
orderedlist
PRO
343
39k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Unsuck your backbone
ammeep
669
57k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Agile that works and the tools we love
rasmusluckow
328
21k
A designer walks into a library…
pauljervisheath
205
24k
Side Projects
sachag
452
42k
Why Our Code Smells
bkeepers
PRO
335
57k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
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