SlideShare uma empresa Scribd logo
1 de 18
Advanced GIT
or How to Change the History
Speaker: Sergey Nezbritskiy
Why ?
2
Prerequisites
list of used commands:
- git show <reference>
- git log --oneline --graph
- git log --oneline --graph --all
What you should know about GIT:
- References in git: commit hash, branch, tag, HEAD
- Fast-forwarding - When merging one commit with a commit that can be reached
by following the first commit’s history, Git simplifies things by moving the
pointer forward because there is no divergent work to merge together
3
4
How
boys git log girls
tell stories
5
* 6e534ad490f (HEAD -> 2.3-develop, origin/HEAD, origin/2.3-develop) Merge pull request #4350 from magento-arcticfoxes/2.3-develop-pr
|
| * bae699dba0c Merge remote-tracking branch 'upstream/2.3-develop' into 2.3-develop-pr
| |
| |/
|/|
* | 977753bce8d Merge pull request #4345 from magento-mpi/pr_2019_06_11_ce
| 
| *  2dce436dabd Merge remote-tracking branch 'magento2/2.3-develop' into pr_2019_06_11_ce
| | 
| |/ /
|/| |
* | | 8e16abce80b Merge pull request #4320 from magento-tsg-csl3/2.3-develop-pr24
|  
| *   9283ef0298a Merge remote-tracking branch 'mainline/2.3-develop' into 2.3-develop-pr24
| |  
| |/ / /
|/| | |
* | | | 163302f4794 Merge pull request #4330 from magento-obsessive-owls/MC-16599
|   
| *    e5ab4b670b0 merge magento/2.3-develop into magento-obsessive-owls/MC-16599
| |   
| |/ / / /
|/| | | |
* | | | | 6801e95b74f Merge pull request #4334 from magento-qwerty/MAGETWO-55809
|    
| *     e5a1e8132f2 merge magento/2.3-develop into magento-qwerty/MAGETWO-55809
| |    
| |/ / / / /
|/| | | | |
| * | | | | b2a75ff3a31 merge magento/2.3-develop into magento-qwerty/MAGETWO-55809
| |    
| *      65a3242dda1 Merge branch 'MAGETWO-55809' of https://github.com/magento-qwerty/magento2ce into MAGETWO-55809
| |     
| | *      d95ece7ef98 merge magento/2.3-develop into magento-qwerty/MAGETWO-55809
| | |     
| | *       4d2757d178f merge magento/2.3-develop into magento-qwerty/MAGETWO-55809
| | |      
| * |        50237fde35c Merge branch '2.3-develop' of https://github.com/magento/magento2ce into MAGETWO-55809
| |        
| * | | | | | | | | | d86efb669ba MAGETWO-55809: Eliminate @escapeNotVerified in Module Backend
| | |/ / / / / / / /
| |/| | | | | | | |
| * | | | | | | | | 0f4f949db01 MAGETWO-55809: Eliminate @escapeNotVerified in Module Backend
git checkout 2.3-develop
git log --oneline --graph
6
TODO: example of perfect repository
¯_(ツ)_/¯
* ceb65ff (HEAD -> prod, tag: 2.5.18) [CHE-300] Contingency Block
* 6baf4b7 RIATCE-735: sticky PDP for a/b testing
* 96fbf9f RIATCE-1511: fix order of loading elements on homepage
* 84dcfce RIATCE-725: add search by image functionality
* 799799c RIATCE-731: implement new PDP
* decd884 RIATCS-1494: fix products count in title
* beec966 RIATCS-1476: changes for SEO, add missing titles
* 4268d31 RIATCS-1524: fix url key, do not replace with click url
* ff4c1e6 (tag: 2.5.17.1) [CHE-639] STS Price Update
* ba56e95 (tag: 2.5.17) [CHE-719] Performance
* 0a76b68 [CHE-707] Saved Brasgpag Card alias fix
* 30b9552 bug/VIT-334 Change query
* 539046c [CHE-466] Customer access token
* 2778ef8 [CHE-689] Valor de frete não aplicado ao cancelar cupom
* 2f4c307 [CHE-712] Fix parcelamento por catálogo
* ebb93cf Fixed virtual card token pattern checking
* 303e93b bug/VIT-409
* 837d021 fixed look data reference used to add to cart
* ebc6ad7 [CHE-652] Remove billet date calc
* b2a849b RIATCS-1494: fix line below header
* 2cc3920 RIATCS-1486: remove disabling old loader in js
* ff48b07 RIATCS-1485: remove old loader
* 4aa81a1 RIATCS-1401: change text in loader
* 3c29d53 RIATCS-1423: merge branch sprint-40-final
* 66a1b55 RIATCS-1476: change text in info_for_user section
* fc980e7 RPV-82 - new front my orders
* 3776b56 RIATCS-1475: add hart icon to gallery.phtm in Xumulus_FastGalleryLoad module
* 467156b (tag: 2.5.17.3) RIATCS-1475 looks pdp issues
* db6e6c7 RIATCS-1483: add functionality for new installment text working only on usual product
7
git checkout prod
git log --oneline --graph
REBASE
Integrates changes from one branch into another.
Rewrites the commit history in order to produce a straight, linear
sequence of commits.
8
REBASE WITH --onto
9
o---o---o---o---o master

o---o---o---x---o stage

o---o---o feature
git rebase --onto master stage feature
o---o---o---x---o master
| 
| o'--o'--o' feature

o---o---o---o---o stage
git rebase [--onto <newbase>] [<oldest commit (excl)> [<newest commit>]]
REBASE EVERYTHING ONTO ANYTHING
1
0
git rebase --onto master stage feature
git rebase --onto HEAD~7 HEAD~4 HEAD
git rebase --onto feature~8 feature~5 feature
git rebase --onto 0f4db90 a14dab7 43ae1cd
REBASE ONTO ITSELF
1
1
E---F---G---H---I---J topicA
E---F---I---J topicA
git rebase --onto F H J
git rebase --onto F F J
git rebase F
E---F---I---J topicA
INTERACTIVE REBASE
1
2
git rebase -i
REVERT
Revert some existing commits by representing new
commit
1
3
RESET
Reset current HEAD to the specified
state
1
4
--soft --mixed (default) --hard
index ✘ ✔ ✔
local tree ✘ ✘ ✔
HARD RESET
git reset --hard
1
5
WARNING !!!
Operations with commit history change commit hashes,
hence if you previously pushed your changes to remote
repository, after changing commits hashes you have to push
it with --force option
1
6
USEFUL RESOURCES
- git <command> --help
- https://git-scm.com/docs
- `git status` suggestions
1
7
REPOSITORY WITH CODE SAMPLES
1
8
https://github.com/magento-meetup-6/umbrella

Mais conteúdo relacionado

Semelhante a Advanced GIT or How to Change the History

DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerSteve Smith
 
Sprint 130
Sprint 130Sprint 130
Sprint 130ManageIQ
 
Git For The Android Developer
Git For The Android DeveloperGit For The Android Developer
Git For The Android DeveloperEffective
 
Introducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task AutomationIntroducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task AutomationScyllaDB
 
Sprint 131
Sprint 131Sprint 131
Sprint 131ManageIQ
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-itAutomat-IT
 
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみるK8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみるJUNICHI YOSHISE
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with DockerDocker, Inc.
 
Using Git as your VCS with Bioconductor
Using Git as your VCS with BioconductorUsing Git as your VCS with Bioconductor
Using Git as your VCS with Bioconductortimyates
 
Packaging Strategy for Community Openstack and Implementation Reference | Hoj...
Packaging Strategy for Community Openstack and Implementation Reference | Hoj...Packaging Strategy for Community Openstack and Implementation Reference | Hoj...
Packaging Strategy for Community Openstack and Implementation Reference | Hoj...Vietnam Open Infrastructure User Group
 
PostgreSQL 13 New Features
PostgreSQL 13 New FeaturesPostgreSQL 13 New Features
PostgreSQL 13 New FeaturesJosé Lin
 
Sprint 124
Sprint 124Sprint 124
Sprint 124ManageIQ
 
Git branching model_for_tap_team
Git branching model_for_tap_teamGit branching model_for_tap_team
Git branching model_for_tap_teamGrzegorz Wilczynski
 
Sprint 133
Sprint 133Sprint 133
Sprint 133ManageIQ
 
Sprint 138
Sprint 138Sprint 138
Sprint 138ManageIQ
 
Sprint 129
Sprint 129Sprint 129
Sprint 129ManageIQ
 

Semelhante a Advanced GIT or How to Change the History (20)

DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to Docker
 
Sprint 130
Sprint 130Sprint 130
Sprint 130
 
Git For The Android Developer
Git For The Android DeveloperGit For The Android Developer
Git For The Android Developer
 
Introducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task AutomationIntroducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task Automation
 
Sprint 131
Sprint 131Sprint 131
Sprint 131
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
 
ARLYN
ARLYNARLYN
ARLYN
 
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみるK8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
K8s上の containerized cloud foundryとcontainerized open stackをprometheusで監視してみる
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 
Using Git as your VCS with Bioconductor
Using Git as your VCS with BioconductorUsing Git as your VCS with Bioconductor
Using Git as your VCS with Bioconductor
 
4 Sessions
4 Sessions4 Sessions
4 Sessions
 
Packaging Strategy for Community Openstack and Implementation Reference | Hoj...
Packaging Strategy for Community Openstack and Implementation Reference | Hoj...Packaging Strategy for Community Openstack and Implementation Reference | Hoj...
Packaging Strategy for Community Openstack and Implementation Reference | Hoj...
 
PostgreSQL 13 New Features
PostgreSQL 13 New FeaturesPostgreSQL 13 New Features
PostgreSQL 13 New Features
 
Magie di git
Magie di gitMagie di git
Magie di git
 
Unleashing git power
Unleashing git powerUnleashing git power
Unleashing git power
 
Sprint 124
Sprint 124Sprint 124
Sprint 124
 
Git branching model_for_tap_team
Git branching model_for_tap_teamGit branching model_for_tap_team
Git branching model_for_tap_team
 
Sprint 133
Sprint 133Sprint 133
Sprint 133
 
Sprint 138
Sprint 138Sprint 138
Sprint 138
 
Sprint 129
Sprint 129Sprint 129
Sprint 129
 

Mais de Magecom UK Limited

Magento Meetup #12. Alex Shkurko.pptx
Magento Meetup #12. Alex Shkurko.pptxMagento Meetup #12. Alex Shkurko.pptx
Magento Meetup #12. Alex Shkurko.pptxMagecom UK Limited
 
Magento Meetup #12 Anastasiia Bondar
Magento Meetup #12 Anastasiia BondarMagento Meetup #12 Anastasiia Bondar
Magento Meetup #12 Anastasiia BondarMagecom UK Limited
 
Magento Meetup #12 Vlad Opukhlyi
Magento Meetup #12 Vlad OpukhlyiMagento Meetup #12 Vlad Opukhlyi
Magento Meetup #12 Vlad OpukhlyiMagecom UK Limited
 
Google Page Insights and Magento 2 — Sergey Nezbritskiy | Magento Meetup Onli...
Google Page Insights and Magento 2 — Sergey Nezbritskiy | Magento Meetup Onli...Google Page Insights and Magento 2 — Sergey Nezbritskiy | Magento Meetup Onli...
Google Page Insights and Magento 2 — Sergey Nezbritskiy | Magento Meetup Onli...Magecom UK Limited
 
Magento NodeJS Microservices — Yegor Shytikov | Magento Meetup Online #11
Magento NodeJS Microservices — Yegor Shytikov | Magento Meetup Online #11Magento NodeJS Microservices — Yegor Shytikov | Magento Meetup Online #11
Magento NodeJS Microservices — Yegor Shytikov | Magento Meetup Online #11Magecom UK Limited
 
Magento enhanced media gallery - Alexander Shkurko
Magento enhanced media gallery - Alexander ShkurkoMagento enhanced media gallery - Alexander Shkurko
Magento enhanced media gallery - Alexander ShkurkoMagecom UK Limited
 
7 ошибок одного Black Friday - Влад Опухлый
7 ошибок одного Black Friday - Влад Опухлый7 ошибок одного Black Friday - Влад Опухлый
7 ошибок одного Black Friday - Влад ОпухлыйMagecom UK Limited
 
Magento & Cloud - Korostelov Avexey
Magento & Cloud - Korostelov AvexeyMagento & Cloud - Korostelov Avexey
Magento & Cloud - Korostelov AvexeyMagecom UK Limited
 
Making the Magento 2 Javascript Loading Great Again - Robin van Raan
Making the Magento 2 Javascript Loading Great Again - Robin van RaanMaking the Magento 2 Javascript Loading Great Again - Robin van Raan
Making the Magento 2 Javascript Loading Great Again - Robin van RaanMagecom UK Limited
 
From Repositories to Commands - Alexander Shkurko
From Repositories to Commands - Alexander Shkurko From Repositories to Commands - Alexander Shkurko
From Repositories to Commands - Alexander Shkurko Magecom UK Limited
 
MSI In-Store Pickup Функционал & сложности
MSI In-Store Pickup Функционал & сложностиMSI In-Store Pickup Функционал & сложности
MSI In-Store Pickup Функционал & сложностиMagecom UK Limited
 
Adobe Stock Integration community project
Adobe Stock Integration community projectAdobe Stock Integration community project
Adobe Stock Integration community projectMagecom UK Limited
 
Proof of Concept for Magento 2 Projects: Occamo’s Razor
Proof of Concept for Magento 2 Projects: Occamo’s RazorProof of Concept for Magento 2 Projects: Occamo’s Razor
Proof of Concept for Magento 2 Projects: Occamo’s RazorMagecom UK Limited
 
Что нужно знать девелоперу о SEO на этапе проектирования сайта
Что нужно знать девелоперу о SEO на этапе проектирования сайтаЧто нужно знать девелоперу о SEO на этапе проектирования сайта
Что нужно знать девелоперу о SEO на этапе проектирования сайтаMagecom UK Limited
 
Magento-сертификация: инструкция по применению и как это было
Magento-сертификация: инструкция по применению и как это былоMagento-сертификация: инструкция по применению и как это было
Magento-сертификация: инструкция по применению и как это былоMagecom UK Limited
 
Experience in Magento Community Projects
Experience in Magento Community ProjectsExperience in Magento Community Projects
Experience in Magento Community ProjectsMagecom UK Limited
 
UI components: synergy of backend and frontend
UI components: synergy of backend and frontendUI components: synergy of backend and frontend
UI components: synergy of backend and frontendMagecom UK Limited
 
MSI - Reservation Challenges with 3rd-party Systems
MSI - Reservation Challenges with 3rd-party SystemsMSI - Reservation Challenges with 3rd-party Systems
MSI - Reservation Challenges with 3rd-party SystemsMagecom UK Limited
 

Mais de Magecom UK Limited (20)

Magento Meetup #12. Alex Shkurko.pptx
Magento Meetup #12. Alex Shkurko.pptxMagento Meetup #12. Alex Shkurko.pptx
Magento Meetup #12. Alex Shkurko.pptx
 
Magento Meetup #12 Anastasiia Bondar
Magento Meetup #12 Anastasiia BondarMagento Meetup #12 Anastasiia Bondar
Magento Meetup #12 Anastasiia Bondar
 
Magento Meetup #12 Vlad Opukhlyi
Magento Meetup #12 Vlad OpukhlyiMagento Meetup #12 Vlad Opukhlyi
Magento Meetup #12 Vlad Opukhlyi
 
Google Page Insights and Magento 2 — Sergey Nezbritskiy | Magento Meetup Onli...
Google Page Insights and Magento 2 — Sergey Nezbritskiy | Magento Meetup Onli...Google Page Insights and Magento 2 — Sergey Nezbritskiy | Magento Meetup Onli...
Google Page Insights and Magento 2 — Sergey Nezbritskiy | Magento Meetup Onli...
 
Magento NodeJS Microservices — Yegor Shytikov | Magento Meetup Online #11
Magento NodeJS Microservices — Yegor Shytikov | Magento Meetup Online #11Magento NodeJS Microservices — Yegor Shytikov | Magento Meetup Online #11
Magento NodeJS Microservices — Yegor Shytikov | Magento Meetup Online #11
 
Magento enhanced media gallery - Alexander Shkurko
Magento enhanced media gallery - Alexander ShkurkoMagento enhanced media gallery - Alexander Shkurko
Magento enhanced media gallery - Alexander Shkurko
 
7 ошибок одного Black Friday - Влад Опухлый
7 ошибок одного Black Friday - Влад Опухлый7 ошибок одного Black Friday - Влад Опухлый
7 ошибок одного Black Friday - Влад Опухлый
 
Magento & Cloud - Korostelov Avexey
Magento & Cloud - Korostelov AvexeyMagento & Cloud - Korostelov Avexey
Magento & Cloud - Korostelov Avexey
 
Making the Magento 2 Javascript Loading Great Again - Robin van Raan
Making the Magento 2 Javascript Loading Great Again - Robin van RaanMaking the Magento 2 Javascript Loading Great Again - Robin van Raan
Making the Magento 2 Javascript Loading Great Again - Robin van Raan
 
Deep Dive in Magento DI
Deep Dive in Magento DIDeep Dive in Magento DI
Deep Dive in Magento DI
 
From Repositories to Commands - Alexander Shkurko
From Repositories to Commands - Alexander Shkurko From Repositories to Commands - Alexander Shkurko
From Repositories to Commands - Alexander Shkurko
 
MSI In-Store Pickup Функционал & сложности
MSI In-Store Pickup Функционал & сложностиMSI In-Store Pickup Функционал & сложности
MSI In-Store Pickup Функционал & сложности
 
Adobe Stock Integration community project
Adobe Stock Integration community projectAdobe Stock Integration community project
Adobe Stock Integration community project
 
Proof of Concept for Magento 2 Projects: Occamo’s Razor
Proof of Concept for Magento 2 Projects: Occamo’s RazorProof of Concept for Magento 2 Projects: Occamo’s Razor
Proof of Concept for Magento 2 Projects: Occamo’s Razor
 
Что нужно знать девелоперу о SEO на этапе проектирования сайта
Что нужно знать девелоперу о SEO на этапе проектирования сайтаЧто нужно знать девелоперу о SEO на этапе проектирования сайта
Что нужно знать девелоперу о SEO на этапе проектирования сайта
 
Magento-сертификация: инструкция по применению и как это было
Magento-сертификация: инструкция по применению и как это былоMagento-сертификация: инструкция по применению и как это было
Magento-сертификация: инструкция по применению и как это было
 
Experience in Magento Community Projects
Experience in Magento Community ProjectsExperience in Magento Community Projects
Experience in Magento Community Projects
 
UI components: synergy of backend and frontend
UI components: synergy of backend and frontendUI components: synergy of backend and frontend
UI components: synergy of backend and frontend
 
MSI - Reservation Challenges with 3rd-party Systems
MSI - Reservation Challenges with 3rd-party SystemsMSI - Reservation Challenges with 3rd-party Systems
MSI - Reservation Challenges with 3rd-party Systems
 
Business wants what?!
Business wants what?!Business wants what?!
Business wants what?!
 

Último

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 

Último (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 

Advanced GIT or How to Change the History

  • 1. Advanced GIT or How to Change the History Speaker: Sergey Nezbritskiy
  • 3. Prerequisites list of used commands: - git show <reference> - git log --oneline --graph - git log --oneline --graph --all What you should know about GIT: - References in git: commit hash, branch, tag, HEAD - Fast-forwarding - When merging one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward because there is no divergent work to merge together 3
  • 4. 4 How boys git log girls tell stories
  • 5. 5 * 6e534ad490f (HEAD -> 2.3-develop, origin/HEAD, origin/2.3-develop) Merge pull request #4350 from magento-arcticfoxes/2.3-develop-pr | | * bae699dba0c Merge remote-tracking branch 'upstream/2.3-develop' into 2.3-develop-pr | | | |/ |/| * | 977753bce8d Merge pull request #4345 from magento-mpi/pr_2019_06_11_ce | | * 2dce436dabd Merge remote-tracking branch 'magento2/2.3-develop' into pr_2019_06_11_ce | | | |/ / |/| | * | | 8e16abce80b Merge pull request #4320 from magento-tsg-csl3/2.3-develop-pr24 | | * 9283ef0298a Merge remote-tracking branch 'mainline/2.3-develop' into 2.3-develop-pr24 | | | |/ / / |/| | | * | | | 163302f4794 Merge pull request #4330 from magento-obsessive-owls/MC-16599 | | * e5ab4b670b0 merge magento/2.3-develop into magento-obsessive-owls/MC-16599 | | | |/ / / / |/| | | | * | | | | 6801e95b74f Merge pull request #4334 from magento-qwerty/MAGETWO-55809 | | * e5a1e8132f2 merge magento/2.3-develop into magento-qwerty/MAGETWO-55809 | | | |/ / / / / |/| | | | | | * | | | | b2a75ff3a31 merge magento/2.3-develop into magento-qwerty/MAGETWO-55809 | | | * 65a3242dda1 Merge branch 'MAGETWO-55809' of https://github.com/magento-qwerty/magento2ce into MAGETWO-55809 | | | | * d95ece7ef98 merge magento/2.3-develop into magento-qwerty/MAGETWO-55809 | | | | | * 4d2757d178f merge magento/2.3-develop into magento-qwerty/MAGETWO-55809 | | | | * | 50237fde35c Merge branch '2.3-develop' of https://github.com/magento/magento2ce into MAGETWO-55809 | | | * | | | | | | | | | d86efb669ba MAGETWO-55809: Eliminate @escapeNotVerified in Module Backend | | |/ / / / / / / / | |/| | | | | | | | | * | | | | | | | | 0f4f949db01 MAGETWO-55809: Eliminate @escapeNotVerified in Module Backend git checkout 2.3-develop git log --oneline --graph
  • 6. 6 TODO: example of perfect repository ¯_(ツ)_/¯
  • 7. * ceb65ff (HEAD -> prod, tag: 2.5.18) [CHE-300] Contingency Block * 6baf4b7 RIATCE-735: sticky PDP for a/b testing * 96fbf9f RIATCE-1511: fix order of loading elements on homepage * 84dcfce RIATCE-725: add search by image functionality * 799799c RIATCE-731: implement new PDP * decd884 RIATCS-1494: fix products count in title * beec966 RIATCS-1476: changes for SEO, add missing titles * 4268d31 RIATCS-1524: fix url key, do not replace with click url * ff4c1e6 (tag: 2.5.17.1) [CHE-639] STS Price Update * ba56e95 (tag: 2.5.17) [CHE-719] Performance * 0a76b68 [CHE-707] Saved Brasgpag Card alias fix * 30b9552 bug/VIT-334 Change query * 539046c [CHE-466] Customer access token * 2778ef8 [CHE-689] Valor de frete não aplicado ao cancelar cupom * 2f4c307 [CHE-712] Fix parcelamento por catálogo * ebb93cf Fixed virtual card token pattern checking * 303e93b bug/VIT-409 * 837d021 fixed look data reference used to add to cart * ebc6ad7 [CHE-652] Remove billet date calc * b2a849b RIATCS-1494: fix line below header * 2cc3920 RIATCS-1486: remove disabling old loader in js * ff48b07 RIATCS-1485: remove old loader * 4aa81a1 RIATCS-1401: change text in loader * 3c29d53 RIATCS-1423: merge branch sprint-40-final * 66a1b55 RIATCS-1476: change text in info_for_user section * fc980e7 RPV-82 - new front my orders * 3776b56 RIATCS-1475: add hart icon to gallery.phtm in Xumulus_FastGalleryLoad module * 467156b (tag: 2.5.17.3) RIATCS-1475 looks pdp issues * db6e6c7 RIATCS-1483: add functionality for new installment text working only on usual product 7 git checkout prod git log --oneline --graph
  • 8. REBASE Integrates changes from one branch into another. Rewrites the commit history in order to produce a straight, linear sequence of commits. 8
  • 9. REBASE WITH --onto 9 o---o---o---o---o master o---o---o---x---o stage o---o---o feature git rebase --onto master stage feature o---o---o---x---o master | | o'--o'--o' feature o---o---o---o---o stage git rebase [--onto <newbase>] [<oldest commit (excl)> [<newest commit>]]
  • 10. REBASE EVERYTHING ONTO ANYTHING 1 0 git rebase --onto master stage feature git rebase --onto HEAD~7 HEAD~4 HEAD git rebase --onto feature~8 feature~5 feature git rebase --onto 0f4db90 a14dab7 43ae1cd
  • 11. REBASE ONTO ITSELF 1 1 E---F---G---H---I---J topicA E---F---I---J topicA git rebase --onto F H J git rebase --onto F F J git rebase F E---F---I---J topicA
  • 13. REVERT Revert some existing commits by representing new commit 1 3
  • 14. RESET Reset current HEAD to the specified state 1 4 --soft --mixed (default) --hard index ✘ ✔ ✔ local tree ✘ ✘ ✔
  • 15. HARD RESET git reset --hard 1 5
  • 16. WARNING !!! Operations with commit history change commit hashes, hence if you previously pushed your changes to remote repository, after changing commits hashes you have to push it with --force option 1 6
  • 17. USEFUL RESOURCES - git <command> --help - https://git-scm.com/docs - `git status` suggestions 1 7
  • 18. REPOSITORY WITH CODE SAMPLES 1 8 https://github.com/magento-meetup-6/umbrella