SlideShare a Scribd company logo

Git Pro Tips

thehoagie
thehoagie

What makes a good commit message? What makes for good commit contents? I present on how to reword commits to provide context, and structure commit contents to be the most meaningful for posterity with git rebase.

1 of 26
Download to read offline
Git Pro Tips
Rebase, squash, and fixup, for tomorrow we may merge
Provide as much context on your change
as you can. Derek Prior asks for two
paragraphs in your commit message
A big ask, but its probably only going to
take you 5 minutes to write, and save the
reader 30 minutes of researching
Give The Reader a Break
Good or Bad Commit Message?
Fix rake db:migrate from scratch
This commit fixes a bug reported by Bindu's team. Currently, since the
Rake task `db:create_di_sql_views` is not versioned, it refers to the
_latest_ state of the database.
This can break stuff if you've dropped your database and are migrating
back up from scratch. A field referenced in the Rake task may not yet
exist.
The solution we've come up with until we upgrade to Rails 4 is to
comment out earlier migrations, leaving only the most recent one.
“Cleaning”
Good or Bad Commit Message?
[#92611712] CP06 executed_at is now Time.zone.now
We had a purchase that initiated a few minutes before midnight, yet
settled after midnight on the following day. This resulted in a CP06
with a transaction value from the previous day (creation date) and was
omitted from the finance_r2 export for the following day range
When a purchase record settles, DiFinanceTransaction.
create_from_flubit_purchase
is called for the CP06 generation, effectively the settled at date.
The executed at time is only modified for CP06 purchases, and is not
used on SH01 records. For SH01, the dispatched date is used instead
Good or Bad Commit Message?
“Merge branch 'echo'”
Good or Bad Commit Message?
Ad

Recommended

Karate for Complex Web-Service API Testing by Peter Thomas
Karate for Complex Web-Service API Testing by Peter ThomasKarate for Complex Web-Service API Testing by Peter Thomas
Karate for Complex Web-Service API Testing by Peter Thomasintuit_india
 
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterHow to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeter
How to Run a 1,000,000 VU Load Test using Apache JMeter and BlazeMeterAlon Girmonsky
 
Find and Fix Performance Bottlenecks with New Relic and BlazeMeter
Find and Fix Performance Bottlenecks with New Relic and BlazeMeter Find and Fix Performance Bottlenecks with New Relic and BlazeMeter
Find and Fix Performance Bottlenecks with New Relic and BlazeMeter Alon Girmonsky
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Bertrand Delacretaz
 
Karate - Web-Service API Testing Made Simple
Karate - Web-Service API Testing Made SimpleKarate - Web-Service API Testing Made Simple
Karate - Web-Service API Testing Made SimpleVodqaBLR
 
Karate - MoT Dallas 26-Oct-2017
Karate - MoT Dallas 26-Oct-2017Karate - MoT Dallas 26-Oct-2017
Karate - MoT Dallas 26-Oct-2017Peter Thomas
 

More Related Content

What's hot

RSpec and Rails
RSpec and RailsRSpec and Rails
RSpec and RailsAlan Hecht
 
Karate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testingKarate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testingRoman Liubun
 
Developing a Culture of Quality Code (Midwest PHP 2020)
Developing a Culture of Quality Code (Midwest PHP 2020)Developing a Culture of Quality Code (Midwest PHP 2020)
Developing a Culture of Quality Code (Midwest PHP 2020)Scott Keck-Warren
 
Gearman and CodeIgniter
Gearman and CodeIgniterGearman and CodeIgniter
Gearman and CodeIgniterErik Giberti
 
A Deep Dive into the W3C WebDriver Specification
A Deep Dive into the W3C WebDriver SpecificationA Deep Dive into the W3C WebDriver Specification
A Deep Dive into the W3C WebDriver SpecificationPeter Thomas
 
Automate right start from API
Automate right start from APIAutomate right start from API
Automate right start from APIRoman Liubun
 
Gearman - Job Queue
Gearman - Job QueueGearman - Job Queue
Gearman - Job QueueDiego Lewin
 
TDC São Paulo 2019 - Trilha DevTest - Karatê DSL - Automatizando testes de AP...
TDC São Paulo 2019 - Trilha DevTest - Karatê DSL - Automatizando testes de AP...TDC São Paulo 2019 - Trilha DevTest - Karatê DSL - Automatizando testes de AP...
TDC São Paulo 2019 - Trilha DevTest - Karatê DSL - Automatizando testes de AP...Samuel Lucas
 
Build Reliable Asynchronous Code with Queueable Apex
Build Reliable Asynchronous Code with Queueable ApexBuild Reliable Asynchronous Code with Queueable Apex
Build Reliable Asynchronous Code with Queueable ApexSalesforce Developers
 
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"NodeUkraine
 
[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScriptHazem Saleh
 
Apex 10 commandments df14
Apex 10 commandments df14Apex 10 commandments df14
Apex 10 commandments df14James Loghry
 
Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8Allen Pike
 
Intro to front-end testing
Intro to front-end testingIntro to front-end testing
Intro to front-end testingJuriy Zaytsev
 

What's hot (20)

RSpec and Rails
RSpec and RailsRSpec and Rails
RSpec and Rails
 
Karate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testingKarate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testing
 
Salesforce asynchronous apex
Salesforce asynchronous apexSalesforce asynchronous apex
Salesforce asynchronous apex
 
Developing a Culture of Quality Code (Midwest PHP 2020)
Developing a Culture of Quality Code (Midwest PHP 2020)Developing a Culture of Quality Code (Midwest PHP 2020)
Developing a Culture of Quality Code (Midwest PHP 2020)
 
Gearman and CodeIgniter
Gearman and CodeIgniterGearman and CodeIgniter
Gearman and CodeIgniter
 
A Deep Dive into the W3C WebDriver Specification
A Deep Dive into the W3C WebDriver SpecificationA Deep Dive into the W3C WebDriver Specification
A Deep Dive into the W3C WebDriver Specification
 
TDD & BDD
TDD & BDDTDD & BDD
TDD & BDD
 
Automate right start from API
Automate right start from APIAutomate right start from API
Automate right start from API
 
BDD for APIs
BDD for APIsBDD for APIs
BDD for APIs
 
Gearman - Job Queue
Gearman - Job QueueGearman - Job Queue
Gearman - Job Queue
 
TDC São Paulo 2019 - Trilha DevTest - Karatê DSL - Automatizando testes de AP...
TDC São Paulo 2019 - Trilha DevTest - Karatê DSL - Automatizando testes de AP...TDC São Paulo 2019 - Trilha DevTest - Karatê DSL - Automatizando testes de AP...
TDC São Paulo 2019 - Trilha DevTest - Karatê DSL - Automatizando testes de AP...
 
Build Reliable Asynchronous Code with Queueable Apex
Build Reliable Asynchronous Code with Queueable ApexBuild Reliable Asynchronous Code with Queueable Apex
Build Reliable Asynchronous Code with Queueable Apex
 
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"
 
TDD, BDD and mocks
TDD, BDD and mocksTDD, BDD and mocks
TDD, BDD and mocks
 
[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript[FullStack NYC 2019] Effective Unit Tests for JavaScript
[FullStack NYC 2019] Effective Unit Tests for JavaScript
 
Apex 10 commandments df14
Apex 10 commandments df14Apex 10 commandments df14
Apex 10 commandments df14
 
Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8
 
Intro to front-end testing
Intro to front-end testingIntro to front-end testing
Intro to front-end testing
 
Angular Unit Test
Angular Unit TestAngular Unit Test
Angular Unit Test
 
Gearman and Perl
Gearman and PerlGearman and Perl
Gearman and Perl
 

Similar to Git Pro Tips

Git 101 - An introduction to Version Control using Git
Git 101 - An introduction to Version Control using Git Git 101 - An introduction to Version Control using Git
Git 101 - An introduction to Version Control using Git John Tighe
 
MagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoMagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoKirill Morozov
 
Simplify writing code with deliberate commits
Simplify writing code with deliberate commitsSimplify writing code with deliberate commits
Simplify writing code with deliberate commitsJoel Chippindale
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitaminAlex Hillman
 
InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)Mydbops
 
Customer Experience: InnoDB Cluster Implementation by PR Karthik
Customer Experience: InnoDB Cluster Implementation by PR KarthikCustomer Experience: InnoDB Cluster Implementation by PR Karthik
Customer Experience: InnoDB Cluster Implementation by PR KarthikMysql User Camp
 
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?Srijan Technologies
 
Optimize the obvious
Optimize the obviousOptimize the obvious
Optimize the obviousdrhenner
 
RedisConf18 - Fail-Safe Starvation-Free Durable Priority Queues in Redis
RedisConf18 - Fail-Safe Starvation-Free Durable Priority Queues in RedisRedisConf18 - Fail-Safe Starvation-Free Durable Priority Queues in Redis
RedisConf18 - Fail-Safe Starvation-Free Durable Priority Queues in RedisRedis Labs
 
How we switched to columnar at SpendHQ
How we switched to columnar at SpendHQHow we switched to columnar at SpendHQ
How we switched to columnar at SpendHQMariaDB plc
 
PgConf US 2015 - ALTER DATABASE ADD more SANITY
PgConf US 2015  - ALTER DATABASE ADD more SANITYPgConf US 2015  - ALTER DATABASE ADD more SANITY
PgConf US 2015 - ALTER DATABASE ADD more SANITYOleksii Kliukin
 
Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!mold
 
Patch File.pdf
Patch File.pdfPatch File.pdf
Patch File.pdfvilaylala
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Working with others using git and Github
Working with others using git and GithubWorking with others using git and Github
Working with others using git and GithubJacob Jenkins
 
給 RD 的 Kubernetes 初體驗 (GDG Cloud KH 2019-08 version)
給 RD 的 Kubernetes 初體驗 (GDG Cloud KH 2019-08 version) 給 RD 的 Kubernetes 初體驗 (GDG Cloud KH 2019-08 version)
給 RD 的 Kubernetes 初體驗 (GDG Cloud KH 2019-08 version) William Yeh
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | WorkshopAnuchit Chalothorn
 

Similar to Git Pro Tips (20)

Git 101 - An introduction to Version Control using Git
Git 101 - An introduction to Version Control using Git Git 101 - An introduction to Version Control using Git
Git 101 - An introduction to Version Control using Git
 
MagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoMagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagento
 
Simplify writing code with deliberate commits
Simplify writing code with deliberate commitsSimplify writing code with deliberate commits
Simplify writing code with deliberate commits
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitamin
 
InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)
 
Customer Experience: InnoDB Cluster Implementation by PR Karthik
Customer Experience: InnoDB Cluster Implementation by PR KarthikCustomer Experience: InnoDB Cluster Implementation by PR Karthik
Customer Experience: InnoDB Cluster Implementation by PR Karthik
 
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 
Optimize the obvious
Optimize the obviousOptimize the obvious
Optimize the obvious
 
RedisConf18 - Fail-Safe Starvation-Free Durable Priority Queues in Redis
RedisConf18 - Fail-Safe Starvation-Free Durable Priority Queues in RedisRedisConf18 - Fail-Safe Starvation-Free Durable Priority Queues in Redis
RedisConf18 - Fail-Safe Starvation-Free Durable Priority Queues in Redis
 
How we switched to columnar at SpendHQ
How we switched to columnar at SpendHQHow we switched to columnar at SpendHQ
How we switched to columnar at SpendHQ
 
PgConf US 2015 - ALTER DATABASE ADD more SANITY
PgConf US 2015  - ALTER DATABASE ADD more SANITYPgConf US 2015  - ALTER DATABASE ADD more SANITY
PgConf US 2015 - ALTER DATABASE ADD more SANITY
 
Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!
 
Patch File.pdf
Patch File.pdfPatch File.pdf
Patch File.pdf
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Working with others using git and Github
Working with others using git and GithubWorking with others using git and Github
Working with others using git and Github
 
給 RD 的 Kubernetes 初體驗 (GDG Cloud KH 2019-08 version)
給 RD 的 Kubernetes 初體驗 (GDG Cloud KH 2019-08 version) 給 RD 的 Kubernetes 初體驗 (GDG Cloud KH 2019-08 version)
給 RD 的 Kubernetes 初體驗 (GDG Cloud KH 2019-08 version)
 
Use Git like a pro - condensed
Use Git like a pro - condensedUse Git like a pro - condensed
Use Git like a pro - condensed
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 

More from thehoagie

Pair programming
Pair programmingPair programming
Pair programmingthehoagie
 
Docker presentation
Docker presentationDocker presentation
Docker presentationthehoagie
 
Database 101
Database 101Database 101
Database 101thehoagie
 
Null object pattern
Null object patternNull object pattern
Null object patternthehoagie
 
Big tables and you - Keeping DDL operatations fast
Big tables and you - Keeping DDL operatations fastBig tables and you - Keeping DDL operatations fast
Big tables and you - Keeping DDL operatations fastthehoagie
 
Angular.js - An introduction for the unitiated
Angular.js - An introduction for the unitiatedAngular.js - An introduction for the unitiated
Angular.js - An introduction for the unitiatedthehoagie
 
Regular expression presentation for the HUB
Regular expression presentation for the HUBRegular expression presentation for the HUB
Regular expression presentation for the HUBthehoagie
 
Converting your JS library to a jQuery plugin
Converting your JS library to a jQuery pluginConverting your JS library to a jQuery plugin
Converting your JS library to a jQuery pluginthehoagie
 
Active records before_type_cast
Active records before_type_castActive records before_type_cast
Active records before_type_castthehoagie
 

More from thehoagie (10)

Pair programming
Pair programmingPair programming
Pair programming
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
 
Database 101
Database 101Database 101
Database 101
 
Hubot
HubotHubot
Hubot
 
Null object pattern
Null object patternNull object pattern
Null object pattern
 
Big tables and you - Keeping DDL operatations fast
Big tables and you - Keeping DDL operatations fastBig tables and you - Keeping DDL operatations fast
Big tables and you - Keeping DDL operatations fast
 
Angular.js - An introduction for the unitiated
Angular.js - An introduction for the unitiatedAngular.js - An introduction for the unitiated
Angular.js - An introduction for the unitiated
 
Regular expression presentation for the HUB
Regular expression presentation for the HUBRegular expression presentation for the HUB
Regular expression presentation for the HUB
 
Converting your JS library to a jQuery plugin
Converting your JS library to a jQuery pluginConverting your JS library to a jQuery plugin
Converting your JS library to a jQuery plugin
 
Active records before_type_cast
Active records before_type_castActive records before_type_cast
Active records before_type_cast
 

Recently uploaded

Dynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineeringDynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineeringMassimo Talia
 
From Challenger to Champion: How SpiraPlan Outperforms JIRA+Plugins
From Challenger to Champion: How SpiraPlan Outperforms JIRA+PluginsFrom Challenger to Champion: How SpiraPlan Outperforms JIRA+Plugins
From Challenger to Champion: How SpiraPlan Outperforms JIRA+PluginsInflectra
 
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, GoogleISPMAIndia
 
Introducing the New FME Community Webinar - Feb 21, 2024 (2).pdf
Introducing the New FME Community Webinar - Feb 21, 2024 (2).pdfIntroducing the New FME Community Webinar - Feb 21, 2024 (2).pdf
Introducing the New FME Community Webinar - Feb 21, 2024 (2).pdfSafe Software
 
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes", Volodymyr TsapFwdays
 
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERNRonnelBaroc
 
Are Human-generated Demonstrations Necessary for In-context Learning?
Are Human-generated Demonstrations Necessary for In-context Learning?Are Human-generated Demonstrations Necessary for In-context Learning?
Are Human-generated Demonstrations Necessary for In-context Learning?MENGSAYLOEM1
 
My sample product research idea for you!
My sample product research idea for you!My sample product research idea for you!
My sample product research idea for you!KivenRaySarsaba
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsEvangelia Mitsopoulou
 
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...Adrian Sanabria
 
The Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product SchoolThe Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product SchoolProduct School
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Product School
 
Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...Product School
 
How to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response PlanHow to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response PlanDatabarracks
 
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24Umar Saif
 
Building Products That Think- Bhaskaran Srinivasan & Ashish Gupta
Building Products That Think- Bhaskaran Srinivasan & Ashish GuptaBuilding Products That Think- Bhaskaran Srinivasan & Ashish Gupta
Building Products That Think- Bhaskaran Srinivasan & Ashish GuptaISPMAIndia
 
Introduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVAIntroduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVARobert McDermott
 
My Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceMy Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceVijayananda Mohire
 
Confoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data scienceConfoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data scienceSusan Ibach
 

Recently uploaded (20)

Dynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineeringDynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineering
 
From Challenger to Champion: How SpiraPlan Outperforms JIRA+Plugins
From Challenger to Champion: How SpiraPlan Outperforms JIRA+PluginsFrom Challenger to Champion: How SpiraPlan Outperforms JIRA+Plugins
From Challenger to Champion: How SpiraPlan Outperforms JIRA+Plugins
 
In sharing we trust. Taking advantage of a diverse consortium to build a tran...
In sharing we trust. Taking advantage of a diverse consortium to build a tran...In sharing we trust. Taking advantage of a diverse consortium to build a tran...
In sharing we trust. Taking advantage of a diverse consortium to build a tran...
 
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google
 
Introducing the New FME Community Webinar - Feb 21, 2024 (2).pdf
Introducing the New FME Community Webinar - Feb 21, 2024 (2).pdfIntroducing the New FME Community Webinar - Feb 21, 2024 (2).pdf
Introducing the New FME Community Webinar - Feb 21, 2024 (2).pdf
 
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
 
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
 
Are Human-generated Demonstrations Necessary for In-context Learning?
Are Human-generated Demonstrations Necessary for In-context Learning?Are Human-generated Demonstrations Necessary for In-context Learning?
Are Human-generated Demonstrations Necessary for In-context Learning?
 
My sample product research idea for you!
My sample product research idea for you!My sample product research idea for you!
My sample product research idea for you!
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applications
 
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...
 
The Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product SchoolThe Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product School
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
 
Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...
 
How to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response PlanHow to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response Plan
 
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
 
Building Products That Think- Bhaskaran Srinivasan & Ashish Gupta
Building Products That Think- Bhaskaran Srinivasan & Ashish GuptaBuilding Products That Think- Bhaskaran Srinivasan & Ashish Gupta
Building Products That Think- Bhaskaran Srinivasan & Ashish Gupta
 
Introduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVAIntroduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVA
 
My Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceMy Journey towards Artificial Intelligence
My Journey towards Artificial Intelligence
 
Confoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data scienceConfoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data science
 

Git Pro Tips

  • 1. Git Pro Tips Rebase, squash, and fixup, for tomorrow we may merge
  • 2. Provide as much context on your change as you can. Derek Prior asks for two paragraphs in your commit message A big ask, but its probably only going to take you 5 minutes to write, and save the reader 30 minutes of researching Give The Reader a Break
  • 3. Good or Bad Commit Message? Fix rake db:migrate from scratch This commit fixes a bug reported by Bindu's team. Currently, since the Rake task `db:create_di_sql_views` is not versioned, it refers to the _latest_ state of the database. This can break stuff if you've dropped your database and are migrating back up from scratch. A field referenced in the Rake task may not yet exist. The solution we've come up with until we upgrade to Rails 4 is to comment out earlier migrations, leaving only the most recent one.
  • 4. “Cleaning” Good or Bad Commit Message?
  • 5. [#92611712] CP06 executed_at is now Time.zone.now We had a purchase that initiated a few minutes before midnight, yet settled after midnight on the following day. This resulted in a CP06 with a transaction value from the previous day (creation date) and was omitted from the finance_r2 export for the following day range When a purchase record settles, DiFinanceTransaction. create_from_flubit_purchase is called for the CP06 generation, effectively the settled at date. The executed at time is only modified for CP06 purchases, and is not used on SH01 records. For SH01, the dispatched date is used instead Good or Bad Commit Message?
  • 6. “Merge branch 'echo'” Good or Bad Commit Message?
  • 7. “Turn it to 11 (fix stores.longitude encrypted column precision)” Good or Bad Commit Message? diff --git a/db/migrate/20150413183503_add_encryption_fields_to_store.rb b/db/migrate/20150413183503_add_encryption_fields_to_store.rb index 6e5aacc..498a25f 100644 --- a/db/migrate/20150413183503_add_encryption_fields_to_store.rb +++ b/db/migrate/20150413183503_add_encryption_fields_to_store.rb @@ -13,7 +13,7 @@ class AddEncryptionFieldsToStore < ActiveRecord::Migration add_column table, :encryption_migration_latitude, :string - add_column table, :encrypted_longitude, :decimal, :precision => 10, :scale => 8 + add_column table, :encrypted_longitude, :decimal, :precision => 11, :scale => 8 add_column table, :encryption_migration_longitude, :string
  • 8. Single Responsibility Principle (SRP) Commits are free! Make lots of smaller commits instead of one big ball of mud Try to structure a commit around one logical theme, e.g. new model, bug fix What Makes a Good Commit?
  • 9. Presentation is important. The way that you categorize and present your changes is as important as the changes themselves. Would you rather have 10 smaller commits under cognitive load, or one commit with +312 -592 line changes? Food For Thought
  • 10. Problem: How many times have you made edits to an email, term paper, long message, or other before you sent it? Did your recipient need to know about all of your in between edits, or just the final message? Keeping A Clean History
  • 11. Solution: Git allows you to change the past (admit it - you’ve always wanted to have this power) Rebasing interactively allows you to introduce in between commits, delete, even combine/split separate commits Git Rebase for a Clean History
  • 12. git log -p git add -p git diff --staged git commit --amend git stash --save Yeah yeah, I already know this... Quick Review of the Basics
  • 13. git reset <target> (unstage file) git reset --hard HEAD@{#} (revert branch) git commit -m “squash! <SHA>” git push origin -f (careful!) git reflog git rebase <target> -i Advanced Concepts In This Talk
  • 14. We will be using rebase to tackle (almost) all of the following scenarios e, edit = use commit, but stop for amending r, reword = use commit, but edit the commit message s, squash = use commit, but meld into previous commit f, fixup = like "squash", but discard this commit's log message Lets Change History
  • 16. Shameless Plug I could demonstrate these scenarios anywhere, but I’m going to plug a pet project called Routastic. http://routastic.herokuapp.com
  • 17. Problem: The order of my commits should be rearranged so they make more sense Possible solution: git rebase, reorder commits Scenario #1 (Order)
  • 18. Problem: Your commit message isn’t descriptive enough and you want to improve it Possible Solution: git commit --amend Possible Solution: git rebase, mark commit as reword Scenario #2 (Description)
  • 19. Problem: You have made a change to a file in one commit that you are now modifying again Possible Solution: git add -p, git commit -m “fixup! <SHA>, git rebase Note autosquash can help here Scenario #3 (Multiple Revisions)
  • 20. Problem: Your commit is too big and you want to break it down Possible Solution: git rebase, mark commit as edit, git reset HEAD~1, git add -p, git commit, git add -p, git commit, etc, git rebase --continue Scenario #4 (Decomposing)
  • 21. To automagically position fixup, squash messages, put this in your gitconfig # ~/.gitconfig [rebase] autosquash = true Git Autosquash
  • 22. Problem: You’ve committed a change to the wrong commit Possible Solution: git rebase, mark commit as edit, git reset HEAD~1, git add -p, git commit -m “fixup <SHA>, git commit -a, git rebase --continue, git rebase Scenario #5 (Conflation)
  • 23. Interactive rebase can be used in conjunction with basic git commands to completely alter the way your feature branch looks Use it with the objective of improving comprehensibility for those after you Reviewing What We’ve Learned
  • 24. Don’t merge your commits like this guy
  • 25. Rebase before you merge Tag with annotation (git tag -a) Merge with --log Minimize merge commits Always review your commit structure before sharing a PR More Git Tips