SlideShare a Scribd company logo
1 of 19
Download to read offline
Git Practices and Guidelines
Harshit Garg
Table of contents
1. Introduction
2. Guidelines
3. Practices
4. Summary
5. References & Readings
1
Introduction
Introduction
This talk is about the guidelines and practices to be followed for the
following actions:
1. commits
2. branching
2
Guidelines
Commit - When and What
General guidelines about when and what to commit
1. Commit Related Changes
2. Commit Early, Commit Often
3. Don’t Commit Half-Done Work
4. Test Before You Commit
5. Write Good Commit Messages
3
Commit Message Pattern
Subject-Body-Footer Pattern
Issue #MB-126 | Remove currency_symbol from Store model
The field is being used neither in front-end nor in
backend. Hence, suitable for deletion. The purpose
of this field is being served by other fields like
currency and currency_sign.
NOTE: Run Migration after this deployment
4
Commit Message
A Commit message should
1. Summarize a change
2. Be valuable and useful to the people reading it
3. Use the imperative tense
4. Be brief in subject line; detailed in body
5. Be consistent
5
Examples - Bad
Some examples of badly styled commit messages:
1. ”bug fix”, ”more work”, ”minor changes”, ”fixes” – These mean
nothing. You may as well supply no commit message. Why did
you even bother to write it?
2. ”Work on feature blah blah”
3. ”Fix BUG-9284”
4. ”Change RADIUS constant to be 10”
5. ”Initial Commit”
6
Commit Message - Good Example
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it
to about 72 characters or so. In some contexts, the firs
line is treated as the subject of an email and the rest
of the text as the body. The blank line separating the
summary from the body is critical (unless you omit the
body entirely); tools like rebase can get confused if
you run the two together.
Further paragraphs come after blank lines.
- Bullet points are okay, too
7
Branch
General guidelines about branching and related issues
1. Choose and follow one branch development model. Examples,
feature branch, trunk based development (TBD), git-flow, etc.
2. Use feature branch for development work
3. Periodically pull from remote repository to have latest changes
in your local repository
8
Practices
Commit Message
We are expected to follow the following rules while writing a commit
message:
1. Follow subject, body and footer pattern
2. Capitalize the subject line
3. Use the imperative mood in the subject line
4. Wrap the subject line between 50-80 characters
5. Do not end the subject line with a period
9
Commit Message - Body
1. Separate subject from body with a blank line
2. Wrap the body at 72 characters
3. Body should contain what and why
4. Use 80 chars as the hard limit
5. Optionally you can annotate the code using markdown
6. Use bullet points in case of avoid long paragraphs
10
Branch - Feature Branch Model
We are expected to follow the following rules while branching:
1. Branch name should be semantic to the feature
2. Naming convention should be <Issue-No>-<env>-<version>,
version being optional
Eg. MB-112-dev, MB-112-test
3. Optional version can be used as a suffix
Eg. MB-112-test-v1
4. Always rebase against the target branch
5. Use separate branch name for testing, development
6. Optional prefix can be hotfix-, etc.
7. Take ownership of managing your feature branches, like
creation, deleting, rebase etc. and avoid branch-hell
11
Summary
Summary
The summary and takeaways are as follows:
1. Follow Subject-Body-Footer pattern in commit message
2. Explain What and Why in commit body in 80 char column width
3. Use the imperative tense in message
4. Do not write a three or four words commit message
5. Avoid . at end in subject line
6. Follow semantic convention while naming branches
7. Rebase source branch against target branch to avoid conflicts
8. Manage your feature branches
12
References & Readings
References & Readings
The following references are useful and supplements the contents
given here:
1. Chris Beams
2. Erlang Reference
3. Andrew Howden Blog
4. Git for Humans
5. Bad Commits
6. Git Karma
7. Git Branching
8. Thoughtworks Blog on Branching
13

More Related Content

Similar to Git_Practices - Guidelines.pdf

Frame switcher library
Frame switcher libraryFrame switcher library
Frame switcher libraryRoman Khachko
 
Software development best practices & coding guidelines
Software development best practices & coding guidelinesSoftware development best practices & coding guidelines
Software development best practices & coding guidelinesAnkur Goyal
 
Madcap Case Study from Write2Users, Denmark
Madcap Case Study from Write2Users, DenmarkMadcap Case Study from Write2Users, Denmark
Madcap Case Study from Write2Users, DenmarkWrite2Users
 
Git branching policy and review comment's prefix
Git branching policy and review comment's prefixGit branching policy and review comment's prefix
Git branching policy and review comment's prefixKumaresh Chandra Baruri
 
Style guideshell
Style guideshellStyle guideshell
Style guideshellblaap
 
Mca2030 object oriented programming – c++
Mca2030  object oriented programming – c++Mca2030  object oriented programming – c++
Mca2030 object oriented programming – c++smumbahelp
 
Complete JavaScript Guide Notes Examples
Complete JavaScript Guide Notes ExamplesComplete JavaScript Guide Notes Examples
Complete JavaScript Guide Notes ExamplesJavier Crisostomo
 
c-coding-standards-and-best-programming-practices.ppt
c-coding-standards-and-best-programming-practices.pptc-coding-standards-and-best-programming-practices.ppt
c-coding-standards-and-best-programming-practices.pptVinayakHospet1
 
Presentation On Email Etiquettes
Presentation On Email EtiquettesPresentation On Email Etiquettes
Presentation On Email EtiquettesKetan Raval
 
Practical Git by Greg Hermo
Practical Git by Greg HermoPractical Git by Greg Hermo
Practical Git by Greg HermoGreg Hermo
 
Chapter vvxxxxxxxxxxx1 - Part 1 (3).pptx
Chapter vvxxxxxxxxxxx1 - Part 1 (3).pptxChapter vvxxxxxxxxxxx1 - Part 1 (3).pptx
Chapter vvxxxxxxxxxxx1 - Part 1 (3).pptxrajinevitable05
 
Best practices in enterprise applications
Best practices in enterprise applicationsBest practices in enterprise applications
Best practices in enterprise applicationsChandra Sekhar Saripaka
 
Standard coding practices
Standard coding practicesStandard coding practices
Standard coding practicesAnilkumar Patil
 
BloombergGPT.pdfA Large Language Model for Finance
BloombergGPT.pdfA Large Language Model for FinanceBloombergGPT.pdfA Large Language Model for Finance
BloombergGPT.pdfA Large Language Model for Finance957671457
 
General instructions Based on the material you lea.docx
General instructions       Based on the material you lea.docxGeneral instructions       Based on the material you lea.docx
General instructions Based on the material you lea.docxshericehewat
 
Clean Code - Part 2
Clean Code - Part 2Clean Code - Part 2
Clean Code - Part 2Knoldus Inc.
 

Similar to Git_Practices - Guidelines.pdf (20)

Pull request review
Pull request reviewPull request review
Pull request review
 
Frame switcher library
Frame switcher libraryFrame switcher library
Frame switcher library
 
Software development best practices & coding guidelines
Software development best practices & coding guidelinesSoftware development best practices & coding guidelines
Software development best practices & coding guidelines
 
Madcap Case Study from Write2Users, Denmark
Madcap Case Study from Write2Users, DenmarkMadcap Case Study from Write2Users, Denmark
Madcap Case Study from Write2Users, Denmark
 
Git branching policy and review comment's prefix
Git branching policy and review comment's prefixGit branching policy and review comment's prefix
Git branching policy and review comment's prefix
 
Style guideshell
Style guideshellStyle guideshell
Style guideshell
 
Mca2030 object oriented programming – c++
Mca2030  object oriented programming – c++Mca2030  object oriented programming – c++
Mca2030 object oriented programming – c++
 
Complete JavaScript Guide Notes Examples
Complete JavaScript Guide Notes ExamplesComplete JavaScript Guide Notes Examples
Complete JavaScript Guide Notes Examples
 
c-coding-standards-and-best-programming-practices.ppt
c-coding-standards-and-best-programming-practices.pptc-coding-standards-and-best-programming-practices.ppt
c-coding-standards-and-best-programming-practices.ppt
 
Presentation On Email Etiquettes
Presentation On Email EtiquettesPresentation On Email Etiquettes
Presentation On Email Etiquettes
 
Good code
Good codeGood code
Good code
 
Practical Git by Greg Hermo
Practical Git by Greg HermoPractical Git by Greg Hermo
Practical Git by Greg Hermo
 
Chapter vvxxxxxxxxxxx1 - Part 1 (3).pptx
Chapter vvxxxxxxxxxxx1 - Part 1 (3).pptxChapter vvxxxxxxxxxxx1 - Part 1 (3).pptx
Chapter vvxxxxxxxxxxx1 - Part 1 (3).pptx
 
Best practices in enterprise applications
Best practices in enterprise applicationsBest practices in enterprise applications
Best practices in enterprise applications
 
NamingConvention
NamingConventionNamingConvention
NamingConvention
 
Standard coding practices
Standard coding practicesStandard coding practices
Standard coding practices
 
BloombergGPT.pdfA Large Language Model for Finance
BloombergGPT.pdfA Large Language Model for FinanceBloombergGPT.pdfA Large Language Model for Finance
BloombergGPT.pdfA Large Language Model for Finance
 
General instructions Based on the material you lea.docx
General instructions       Based on the material you lea.docxGeneral instructions       Based on the material you lea.docx
General instructions Based on the material you lea.docx
 
Clean Code - Part 2
Clean Code - Part 2Clean Code - Part 2
Clean Code - Part 2
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 

Recently uploaded

办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 

Recently uploaded (20)

办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 

Git_Practices - Guidelines.pdf

  • 1. Git Practices and Guidelines Harshit Garg
  • 2. Table of contents 1. Introduction 2. Guidelines 3. Practices 4. Summary 5. References & Readings 1
  • 4. Introduction This talk is about the guidelines and practices to be followed for the following actions: 1. commits 2. branching 2
  • 6. Commit - When and What General guidelines about when and what to commit 1. Commit Related Changes 2. Commit Early, Commit Often 3. Don’t Commit Half-Done Work 4. Test Before You Commit 5. Write Good Commit Messages 3
  • 7. Commit Message Pattern Subject-Body-Footer Pattern Issue #MB-126 | Remove currency_symbol from Store model The field is being used neither in front-end nor in backend. Hence, suitable for deletion. The purpose of this field is being served by other fields like currency and currency_sign. NOTE: Run Migration after this deployment 4
  • 8. Commit Message A Commit message should 1. Summarize a change 2. Be valuable and useful to the people reading it 3. Use the imperative tense 4. Be brief in subject line; detailed in body 5. Be consistent 5
  • 9. Examples - Bad Some examples of badly styled commit messages: 1. ”bug fix”, ”more work”, ”minor changes”, ”fixes” – These mean nothing. You may as well supply no commit message. Why did you even bother to write it? 2. ”Work on feature blah blah” 3. ”Fix BUG-9284” 4. ”Change RADIUS constant to be 10” 5. ”Initial Commit” 6
  • 10. Commit Message - Good Example Capitalized, short (50 chars or less) summary More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the firs line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together. Further paragraphs come after blank lines. - Bullet points are okay, too 7
  • 11. Branch General guidelines about branching and related issues 1. Choose and follow one branch development model. Examples, feature branch, trunk based development (TBD), git-flow, etc. 2. Use feature branch for development work 3. Periodically pull from remote repository to have latest changes in your local repository 8
  • 13. Commit Message We are expected to follow the following rules while writing a commit message: 1. Follow subject, body and footer pattern 2. Capitalize the subject line 3. Use the imperative mood in the subject line 4. Wrap the subject line between 50-80 characters 5. Do not end the subject line with a period 9
  • 14. Commit Message - Body 1. Separate subject from body with a blank line 2. Wrap the body at 72 characters 3. Body should contain what and why 4. Use 80 chars as the hard limit 5. Optionally you can annotate the code using markdown 6. Use bullet points in case of avoid long paragraphs 10
  • 15. Branch - Feature Branch Model We are expected to follow the following rules while branching: 1. Branch name should be semantic to the feature 2. Naming convention should be <Issue-No>-<env>-<version>, version being optional Eg. MB-112-dev, MB-112-test 3. Optional version can be used as a suffix Eg. MB-112-test-v1 4. Always rebase against the target branch 5. Use separate branch name for testing, development 6. Optional prefix can be hotfix-, etc. 7. Take ownership of managing your feature branches, like creation, deleting, rebase etc. and avoid branch-hell 11
  • 17. Summary The summary and takeaways are as follows: 1. Follow Subject-Body-Footer pattern in commit message 2. Explain What and Why in commit body in 80 char column width 3. Use the imperative tense in message 4. Do not write a three or four words commit message 5. Avoid . at end in subject line 6. Follow semantic convention while naming branches 7. Rebase source branch against target branch to avoid conflicts 8. Manage your feature branches 12
  • 19. References & Readings The following references are useful and supplements the contents given here: 1. Chris Beams 2. Erlang Reference 3. Andrew Howden Blog 4. Git for Humans 5. Bad Commits 6. Git Karma 7. Git Branching 8. Thoughtworks Blog on Branching 13