Submit Search
Upload
Git rebase -i
•
Download as PPTX, PDF
•
21 likes
•
2,446 views
Charile Tsai
Follow
Some simple usage tips for $ git rebase -i. (git rebase interactive)
Read less
Read more
Software
Report
Share
Report
Share
1 of 32
Download now
Recommended
Git教學
Git教學
Sitg Yao
Git 實務圖解
Git 實務圖解
Pokai Chang
Android Thread
Android Thread
Charile Tsai
寫給大家的 Git 教學
寫給大家的 Git 教學
littlebtc
Android AIDL Concept
Android AIDL Concept
Charile Tsai
Introduction of Android View
Introduction of Android View
Charile Tsai
Android Transition
Android Transition
Charile Tsai
Android Service
Android Service
Charile Tsai
Recommended
Git教學
Git教學
Sitg Yao
Git 實務圖解
Git 實務圖解
Pokai Chang
Android Thread
Android Thread
Charile Tsai
寫給大家的 Git 教學
寫給大家的 Git 教學
littlebtc
Android AIDL Concept
Android AIDL Concept
Charile Tsai
Introduction of Android View
Introduction of Android View
Charile Tsai
Android Transition
Android Transition
Charile Tsai
Android Service
Android Service
Charile Tsai
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
More Related Content
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Git rebase -i
1.
Git rebase -i Charlie
Tsai
2.
Git rebase -i Charlie
Tsai
3.
Agenda • 修改多個commit message •
合併commit • 改變commit順序 • 嫁接branch • 上述事情發生時,實際上背後git做了什麼
4.
修改commit • 改HEAD上的commit ->
$ git commit —amend • 改多個怎麼辦?
5.
用—amend的case N1 N0 N2 Checkout Base
6.
用—amend的case N1 N0 N2 git commit —amend Base
7.
用—amend的case N1 New N0’ N2 Base
8.
實際狀況 N1 New N0’ N2 Base N0 灰色表示detached (想成孤兒就好)
9.
用—amend的case N1 New N0 N2 Base New N1 只好cherry-pick N1再amend (就算N1不改commit message 也要cherry-pick)
10.
用—amend的case N1 New N0 N2 Base New N1 N2也要 cherry-pick再amend New N2
11.
真心麻煩!
12.
改用rebase N1 N0 N2 Checkout Base
13.
改用rebase N1 N0 N2 git rebase -i
Base Base
14.
改用rebase New N1 New N0 New N2 Base
15.
實際狀況 New N1 New N0 New N2 Base N1 N0 N2
16.
一步到位!
17.
改變commit順序 Base N0 N1 git checkout
18.
改變commit順序 Base N0 N1 git rebase Base
-i
19.
改變commit順序 Base N1 N0
20.
實際狀況 Base New N1 New N0 N0 N1
21.
改順序的應用情境 • 整理branch上的commit • 某個branch上的commit想先merge回master,就 可以先拉到branch的頭,把那個commit給merge 回master
22.
合併commit Base N0 N1
23.
合併commit Base New N0
24.
實際狀況 Base New N0 N0 N1
25.
合併的使用情境 • 避免太過瑣碎的commit • 寫新的class/module時可以step
by step,最後再 整理成較少的commit • 一次改比較多東西但又希望只有一個commit的時 候,中間可以先commit一些暫存點,最後再合併 (# 也可以用git stash, 但stash太多會亂)
26.
嫁接branch Base Base_ 1 N0 N1 N2 想把N0的前一個commit改到Base_1這點上
27.
嫁接branch Base Base_ 1 N0 N1 N2 git checkout
28.
嫁接branch Base Base_ 1 N0 N1 N2 git rebase -i
Base_1
29.
嫁接branch Base Base_ 1 New N0 New N1 New N2
30.
實際狀況 Base Base_ 1 New N0 New N1 New N2 N0 N1 N2
31.
嫁接的使用情境 • 當你開發一個很大/需時較久時的功能 • 避免你開發到一半的branch沒法merge回master 也避免merge回去卻不會動時,沒有頭緒 •
local有多個瑣碎但高度相關的branch,可以整理 成一個branch再merge回master
32.
Question?
Download now