SlideShare a Scribd company logo
1 of 2
GIT Best Practices
1. Before starting with GIT: add yourUser Name and email tothe configurations sothatyour
changescan be tracked.
2. Commit early and often: Try to commityourcode as soonas youare done withitand tested
it locally,thiswillprotectyoufromgettingintoanytrouble of forgettingthe changesorserious
merge conflictsatlaterstage.
3. Give proper comments: Alwaysgive propercomments (be verygenerous) toyourcheck-ins.
Neveruse commentslike “Code update”or“Updatedcode”or “Code change” or “Bug Fix”
insteadgive smartcomments.AlwaysaddJIRA ticketidinthe commentif availableandgive a
brief descriptionof the change thatyou have made.Forexample like
a. “JIRA Id: XXYYZZ FixedLoginIssue with…….”
b. “Addedcode forfunctionality……..Ref:abcd.doc”
c. “Updatedfollowingsectionof code for……..Ref: …….”
 Firstline of the commentshouldbe like subjectline of a formal email crisp,concise but
still elaborative.
 Afterthe subjectline give ablankline thenprovide with asummaryparagraphfollowed
by the descriptionparagraphif required.
 Bulletpointsare ok
4. Never do bulk commits: Neverevercommitalotof filestogetherunlesstheyare relatedtoa
single ticketorpatch.Most oftenthe ticketor the change withdeal witha most 2-3 files/scripts
committhemtogetherbutdon’tpushunrelatedfilestogether.Thisapproachwill make the
trackingeasyand incase of a rollbackitwill save alot of trouble.
5. Double check the branch towhich you are committing: Before makinganycommitdouble
checkto whichbranch youare committingyourcode.Itwouldbe bestif you alwaysworkwith
the requiredbranchforyour development.
6. Never check in your local configuration file:Alwayscreate alocal configurationfileforyour
projectand use that nevermodifyprojectlevel genericconfigurationfile forexample create a
“config-local.ini”or“log4J-local.properties”andaddthe local configurationfile tothe listof
ignore files listsothattheywon’tbe pickedupbyrepo.
7. Always pull the code before commit:There can be seriousmerge conflictsif youdonot doa
frequentpull of the latestcode fromthe repository.Rememberalwayspullthe latestcode
merge yourchangesintoit thenpushyourcommits.
8. Never develop on master branch:Alwaysuse the “Dev”or “Bug Fix”or the particularsprint
branch “Sprint_1_Dev”but neverworkonmasterdirectly.
DO’S
 Do frequentcommits
 Give proper comments
 Use proper branch for commits
 Always include local configuration files in ignorelist
 Always pull then push not the other way round
DONT’s
 Never do bulk commits
 Never commit local configuration files
 Never do purgeon repository
 Don’ttry to be a “HERO” if you think you have screwed the
repository “ASKFOR HELP”
 Never commit to master branch directly

More Related Content

What's hot

vREST Test Automation
vREST Test AutomationvREST Test Automation
vREST Test AutomationPankaj Jangid
 
Code Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsCode Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsDana Luther
 
Validations 101
Validations 101Validations 101
Validations 101Tom Ridge
 
Device Testing with AWS Device Farm
Device Testing with AWS Device FarmDevice Testing with AWS Device Farm
Device Testing with AWS Device FarmAmazon Web Services
 
POST/CON 2019 - 10 Things You Didn't Know That Postman Can Do (Slides)
POST/CON 2019  - 10 Things You Didn't Know That Postman Can Do (Slides)POST/CON 2019  - 10 Things You Didn't Know That Postman Can Do (Slides)
POST/CON 2019 - 10 Things You Didn't Know That Postman Can Do (Slides)Valentin Despa
 

What's hot (7)

vREST Test Automation
vREST Test AutomationvREST Test Automation
vREST Test Automation
 
Code Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsCode Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application Migrations
 
Validations 101
Validations 101Validations 101
Validations 101
 
Device Testing with AWS Device Farm
Device Testing with AWS Device FarmDevice Testing with AWS Device Farm
Device Testing with AWS Device Farm
 
Tdd
TddTdd
Tdd
 
POST/CON 2019 - 10 Things You Didn't Know That Postman Can Do (Slides)
POST/CON 2019  - 10 Things You Didn't Know That Postman Can Do (Slides)POST/CON 2019  - 10 Things You Didn't Know That Postman Can Do (Slides)
POST/CON 2019 - 10 Things You Didn't Know That Postman Can Do (Slides)
 
Agile android
Agile androidAgile android
Agile android
 

Viewers also liked

O Diferencial de uma Estratégia Mobile...e Multiplataforma!
O Diferencial de uma Estratégia Mobile...e Multiplataforma!O Diferencial de uma Estratégia Mobile...e Multiplataforma!
O Diferencial de uma Estratégia Mobile...e Multiplataforma!Xpand IT
 
VirtualSense presentation at FBK
VirtualSense presentation at FBKVirtualSense presentation at FBK
VirtualSense presentation at FBKAlessandro Bogliolo
 
Secret Life of a Weather Datum end of project event
Secret Life of a Weather Datum end of project eventSecret Life of a Weather Datum end of project event
Secret Life of a Weather Datum end of project eventlifeofdata
 
2016 SRA Globalization Poster_Justice_Caruson
2016 SRA Globalization Poster_Justice_Caruson2016 SRA Globalization Poster_Justice_Caruson
2016 SRA Globalization Poster_Justice_CarusonSandy Justice
 
Heavy Metal PowerPivot Remastered
Heavy Metal PowerPivot RemasteredHeavy Metal PowerPivot Remastered
Heavy Metal PowerPivot RemasteredJason Himmelstein
 
BPM & Enterprise Middleware - Datasheet
BPM & Enterprise Middleware - DatasheetBPM & Enterprise Middleware - Datasheet
BPM & Enterprise Middleware - DatasheetXpand IT
 
Review: Leadership Frameworks
Review: Leadership FrameworksReview: Leadership Frameworks
Review: Leadership FrameworksMariam Nazarudin
 
Challenges in opening up qualitative research data
Challenges in opening up qualitative research dataChallenges in opening up qualitative research data
Challenges in opening up qualitative research datalifeofdata
 
Mgidigitalglobalization
MgidigitalglobalizationMgidigitalglobalization
MgidigitalglobalizationVera Kovaleva
 
Amadeus big data
Amadeus big dataAmadeus big data
Amadeus big data승필 고
 
Division of roles and responsibilities
Division of roles and responsibilitiesDivision of roles and responsibilities
Division of roles and responsibilitieskausargulaid
 
R Statistics With MongoDB
R Statistics With MongoDBR Statistics With MongoDB
R Statistics With MongoDBMongoDB
 
Science Communication 2.0: changing University attitude through Science resea...
Science Communication 2.0: changing University attitude through Science resea...Science Communication 2.0: changing University attitude through Science resea...
Science Communication 2.0: changing University attitude through Science resea...Miquel Duran
 
Online Travel: Today and Tomorrow
Online Travel: Today and TomorrowOnline Travel: Today and Tomorrow
Online Travel: Today and TomorrowYanis Dzenis
 
Introduction Pentaho 5.0
Introduction Pentaho 5.0 Introduction Pentaho 5.0
Introduction Pentaho 5.0 Xpand IT
 
Introduction to jira
Introduction to jiraIntroduction to jira
Introduction to jiraXpand IT
 
USJBF Overview Presentation
USJBF Overview PresentationUSJBF Overview Presentation
USJBF Overview Presentationkdieckgraeff
 
Migrating to git
Migrating to gitMigrating to git
Migrating to gitXpand IT
 
Tecnologìas de la Información y la Comunicación
Tecnologìas de la Información y la ComunicaciónTecnologìas de la Información y la Comunicación
Tecnologìas de la Información y la ComunicaciónYenmely
 

Viewers also liked (20)

O Diferencial de uma Estratégia Mobile...e Multiplataforma!
O Diferencial de uma Estratégia Mobile...e Multiplataforma!O Diferencial de uma Estratégia Mobile...e Multiplataforma!
O Diferencial de uma Estratégia Mobile...e Multiplataforma!
 
VirtualSense presentation at FBK
VirtualSense presentation at FBKVirtualSense presentation at FBK
VirtualSense presentation at FBK
 
Secret Life of a Weather Datum end of project event
Secret Life of a Weather Datum end of project eventSecret Life of a Weather Datum end of project event
Secret Life of a Weather Datum end of project event
 
2016 SRA Globalization Poster_Justice_Caruson
2016 SRA Globalization Poster_Justice_Caruson2016 SRA Globalization Poster_Justice_Caruson
2016 SRA Globalization Poster_Justice_Caruson
 
Heavy Metal PowerPivot Remastered
Heavy Metal PowerPivot RemasteredHeavy Metal PowerPivot Remastered
Heavy Metal PowerPivot Remastered
 
BPM & Enterprise Middleware - Datasheet
BPM & Enterprise Middleware - DatasheetBPM & Enterprise Middleware - Datasheet
BPM & Enterprise Middleware - Datasheet
 
Review: Leadership Frameworks
Review: Leadership FrameworksReview: Leadership Frameworks
Review: Leadership Frameworks
 
Challenges in opening up qualitative research data
Challenges in opening up qualitative research dataChallenges in opening up qualitative research data
Challenges in opening up qualitative research data
 
Mgidigitalglobalization
MgidigitalglobalizationMgidigitalglobalization
Mgidigitalglobalization
 
Amadeus big data
Amadeus big dataAmadeus big data
Amadeus big data
 
Division of roles and responsibilities
Division of roles and responsibilitiesDivision of roles and responsibilities
Division of roles and responsibilities
 
R Statistics With MongoDB
R Statistics With MongoDBR Statistics With MongoDB
R Statistics With MongoDB
 
Science Communication 2.0: changing University attitude through Science resea...
Science Communication 2.0: changing University attitude through Science resea...Science Communication 2.0: changing University attitude through Science resea...
Science Communication 2.0: changing University attitude through Science resea...
 
Online Travel: Today and Tomorrow
Online Travel: Today and TomorrowOnline Travel: Today and Tomorrow
Online Travel: Today and Tomorrow
 
Introduction Pentaho 5.0
Introduction Pentaho 5.0 Introduction Pentaho 5.0
Introduction Pentaho 5.0
 
Introduction to jira
Introduction to jiraIntroduction to jira
Introduction to jira
 
USJBF Overview Presentation
USJBF Overview PresentationUSJBF Overview Presentation
USJBF Overview Presentation
 
Migrating to git
Migrating to gitMigrating to git
Migrating to git
 
Special project
Special projectSpecial project
Special project
 
Tecnologìas de la Información y la Comunicación
Tecnologìas de la Información y la ComunicaciónTecnologìas de la Información y la Comunicación
Tecnologìas de la Información y la Comunicación
 

Similar to GIT Best Practices

Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jiralenamattt
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins UsersAndrew Bayer
 
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko
 
Introduction to Git for Force.com Developers
Introduction to Git for Force.com DevelopersIntroduction to Git for Force.com Developers
Introduction to Git for Force.com DevelopersSalesforce Developers
 
Dreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developersDreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developersJohn Stevenson
 
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama StudiosMagento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama StudiosErik Hansen
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testersupadhyay_25
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOCCarl Lu
 
Continuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.orgContinuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.orgMarcinStachniuk
 
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation Zivtech, LLC
 
Version control git day01
Version control   git day01Version control   git day01
Version control git day01Gourav Varma
 
Version control git day01
Version control   git day01Version control   git day01
Version control git day01Gourav Varma
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git WorkshopBeckhamWee
 

Similar to GIT Best Practices (20)

Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jira
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015
 
Git
GitGit
Git
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
 
Introduction to Git for Force.com Developers
Introduction to Git for Force.com DevelopersIntroduction to Git for Force.com Developers
Introduction to Git for Force.com Developers
 
Dreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developersDreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developers
 
Synergis University 2014- iLogic Do's and Don'ts
Synergis University 2014- iLogic Do's and Don'tsSynergis University 2014- iLogic Do's and Don'ts
Synergis University 2014- iLogic Do's and Don'ts
 
Introduction to Git (part 3)
Introduction to Git (part 3)Introduction to Git (part 3)
Introduction to Git (part 3)
 
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama StudiosMagento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
 
ID E's features
ID E's featuresID E's features
ID E's features
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testers
 
The Basic Concept Of IOC
The Basic Concept Of IOCThe Basic Concept Of IOC
The Basic Concept Of IOC
 
Readme
ReadmeReadme
Readme
 
Continuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.orgContinuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.org
 
VersionEEring
VersionEEringVersionEEring
VersionEEring
 
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
Probo.ci Drupal 4 Gov Devops 1/2 day Presentation
 
Version control git day01
Version control   git day01Version control   git day01
Version control git day01
 
Version control git day01
Version control   git day01Version control   git day01
Version control git day01
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git Workshop
 

GIT Best Practices

  • 1. GIT Best Practices 1. Before starting with GIT: add yourUser Name and email tothe configurations sothatyour changescan be tracked. 2. Commit early and often: Try to commityourcode as soonas youare done withitand tested it locally,thiswillprotectyoufromgettingintoanytrouble of forgettingthe changesorserious merge conflictsatlaterstage. 3. Give proper comments: Alwaysgive propercomments (be verygenerous) toyourcheck-ins. Neveruse commentslike “Code update”or“Updatedcode”or “Code change” or “Bug Fix” insteadgive smartcomments.AlwaysaddJIRA ticketidinthe commentif availableandgive a brief descriptionof the change thatyou have made.Forexample like a. “JIRA Id: XXYYZZ FixedLoginIssue with…….” b. “Addedcode forfunctionality……..Ref:abcd.doc” c. “Updatedfollowingsectionof code for……..Ref: …….”  Firstline of the commentshouldbe like subjectline of a formal email crisp,concise but still elaborative.  Afterthe subjectline give ablankline thenprovide with asummaryparagraphfollowed by the descriptionparagraphif required.  Bulletpointsare ok 4. Never do bulk commits: Neverevercommitalotof filestogetherunlesstheyare relatedtoa single ticketorpatch.Most oftenthe ticketor the change withdeal witha most 2-3 files/scripts committhemtogetherbutdon’tpushunrelatedfilestogether.Thisapproachwill make the trackingeasyand incase of a rollbackitwill save alot of trouble. 5. Double check the branch towhich you are committing: Before makinganycommitdouble checkto whichbranch youare committingyourcode.Itwouldbe bestif you alwaysworkwith the requiredbranchforyour development. 6. Never check in your local configuration file:Alwayscreate alocal configurationfileforyour projectand use that nevermodifyprojectlevel genericconfigurationfile forexample create a “config-local.ini”or“log4J-local.properties”andaddthe local configurationfile tothe listof ignore files listsothattheywon’tbe pickedupbyrepo. 7. Always pull the code before commit:There can be seriousmerge conflictsif youdonot doa frequentpull of the latestcode fromthe repository.Rememberalwayspullthe latestcode merge yourchangesintoit thenpushyourcommits. 8. Never develop on master branch:Alwaysuse the “Dev”or “Bug Fix”or the particularsprint branch “Sprint_1_Dev”but neverworkonmasterdirectly.
  • 2. DO’S  Do frequentcommits  Give proper comments  Use proper branch for commits  Always include local configuration files in ignorelist  Always pull then push not the other way round DONT’s  Never do bulk commits  Never commit local configuration files  Never do purgeon repository  Don’ttry to be a “HERO” if you think you have screwed the repository “ASKFOR HELP”  Never commit to master branch directly