SlideShare a Scribd company logo
1 of 16
Download to read offline
Git 
An introduction! 
! 
Srikanth Sombhatla
Scope 
• Just a soft introduction. 
• Introduces you to terms and best practices. 
• Hands-on. 
• But you should practice !
Why Git 
“A good developer is also 
good at code management.” 
• Simple to work with. 
• Non linear development and distributed development. 
• Fast and robust. 
• Manages complex code merges.
Baby steps 
3 magical ways to learn git 
• Always use command line. 
• Always use command line. 
• Always use command line. 
because with GUI you never get hands-on !
Lets speak the same language 
commit 
• A snapshot of code change. 
• Captures what, who and when changed. 
• Commit id is unique to your repository. 
commit 86da7a8dd0be71842744fc8aadf3dc5ced28f3dd! 
Author: Srikanth Sombhatla <srikanth@zippr.in>! 
Date: Thu Nov 6 16:02:11 2014 +0530! 
! 
improved subscription sync. fixed issues and 
minor refactorings
Lets speak the same language 
branch 
• A chain of commits. 
• In the context of branch of development 
• Topmost commit of the branch is called HEAD 
• Use HEAD to reset the branch incase of any issues. 
• You loose all your changes !! 
git branch! 
Dev! 
inplace_zoom! 
inplace_zoom_i2! 
perf_async_loading! 
* pictures! 
rel_indian_summer_1.8.2!
Lets speak the same language 
repository 
• A working tree. Completely self contained. 
• The collection of your code and their branches. 
• In server this is called remote repository! 
• On local machine this is called local repository! 
• You clone a remote repository! 
• You init a local repository
Lets speak the same language 
clone 
• a remote repository reflected in your local. 
• actually you are following that git repository.! 
push 
• All local commits uploaded to remote 
pull 
• All commits downloaded to local!
Lets do some hands-on.
Some useful git commands 
• git status 
• git log 
• git checkout -b <new branch name> 
• git add 
• git stash 
• git merge 
• git cherry-pick 
• git push -v origin <branch_name>
What is a good commit? 
• One commit - One change. 
• This can have multiple files relevant to one change. 
• Never combine multiple irrelevant changes into one commit. 
• Because you cannot rollback a particular change. 
• Because it is difficult to do code review. 
• Because it is just not clean. 
• Your commit message should be self explanatory.
Commit work flow 
• Make sure you are in the correct branch 
• git branch 
• Check status 
• git status 
• Review your changes - is this what you want to commit ? 
• git difftool 
• any standard tool like opendiff can act as git difftool 
• git commit 
• Once done these changes are committed to staging.
Branching strategy 
• One feature - one branch. 
• Ex: pictures, performance, bugfixes etc 
• All code changes for this feature are confined to this branch. 
• You work independently. 
• Anytime switch to another branch. Revisit and continue your work.
Simple Branching strategy 
bugfixes_1 
layouts 
notification 
sync 
development branches 
QA2 
QA 
REL1 
REL2 
master 
QA1 
REL3 
REL4 
merging 
nightly builds 
pictures
Release strategy 
• One production release - one branch. 
• After release freeze this branch and never push anything 
upstream. 
• Reference code in future. 
• Helps in applying hot fixes
Questions please

More Related Content

What's hot

Sample From Ramesh
Sample From RameshSample From Ramesh
Sample From RameshRamesh Kumar
 
Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Noa Harel
 
Continuous integrations - Basics
Continuous integrations - BasicsContinuous integrations - Basics
Continuous integrations - BasicsBarış İNANÇ
 
#ITsubbotnik Spring 2017: Andriy Filatov "Ансамбль солёных поваров: сравнивае...
#ITsubbotnik Spring 2017: Andriy Filatov "Ансамбль солёных поваров: сравнивае...#ITsubbotnik Spring 2017: Andriy Filatov "Ансамбль солёных поваров: сравнивае...
#ITsubbotnik Spring 2017: Andriy Filatov "Ансамбль солёных поваров: сравнивае...epamspb
 
Software Versioining: A Time Travel Problem in Software Engineering
Software Versioining: A Time Travel Problem in Software EngineeringSoftware Versioining: A Time Travel Problem in Software Engineering
Software Versioining: A Time Travel Problem in Software EngineeringPavel Shukhman
 
My slides from SECR'2018
My slides from SECR'2018My slides from SECR'2018
My slides from SECR'2018Alex Chistyakov
 
GitLab 8.5 Highlights and Step-by-step tutorial
GitLab 8.5 Highlights and Step-by-step tutorialGitLab 8.5 Highlights and Step-by-step tutorial
GitLab 8.5 Highlights and Step-by-step tutorialHeather McNamee
 
Culture of working together with git
Culture of working together  with gitCulture of working together  with git
Culture of working together with gitibrahimgunduz34
 
Continuous Delivery at Snyk
Continuous Delivery at SnykContinuous Delivery at Snyk
Continuous Delivery at SnykAnton Drukh
 
Flex and .NET Integration
Flex and .NET IntegrationFlex and .NET Integration
Flex and .NET Integrationicaraion
 
Intro to Git for Project Managers
Intro to Git for Project ManagersIntro to Git for Project Managers
Intro to Git for Project ManagersOyeLabs
 
Continuous Deployment of Architectural Change
Continuous Deployment of Architectural ChangeContinuous Deployment of Architectural Change
Continuous Deployment of Architectural ChangeMatt Graham
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowMikhail Melnik
 
PUG Romagna - Pipeline + Deployer PHP
PUG Romagna - Pipeline + Deployer PHPPUG Romagna - Pipeline + Deployer PHP
PUG Romagna - Pipeline + Deployer PHPGiuseppe Morelli
 
Beautiful Builds - Roy Osherove at Microsoft Swit
Beautiful Builds - Roy Osherove at Microsoft SwitBeautiful Builds - Roy Osherove at Microsoft Swit
Beautiful Builds - Roy Osherove at Microsoft SwitRoy Osherove
 

What's hot (20)

Sample From Ramesh
Sample From RameshSample From Ramesh
Sample From Ramesh
 
Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)
 
Continuous integrations - Basics
Continuous integrations - BasicsContinuous integrations - Basics
Continuous integrations - Basics
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
#ITsubbotnik Spring 2017: Andriy Filatov "Ансамбль солёных поваров: сравнивае...
#ITsubbotnik Spring 2017: Andriy Filatov "Ансамбль солёных поваров: сравнивае...#ITsubbotnik Spring 2017: Andriy Filatov "Ансамбль солёных поваров: сравнивае...
#ITsubbotnik Spring 2017: Andriy Filatov "Ансамбль солёных поваров: сравнивае...
 
Software Versioining: A Time Travel Problem in Software Engineering
Software Versioining: A Time Travel Problem in Software EngineeringSoftware Versioining: A Time Travel Problem in Software Engineering
Software Versioining: A Time Travel Problem in Software Engineering
 
My slides from SECR'2018
My slides from SECR'2018My slides from SECR'2018
My slides from SECR'2018
 
GitLab 8.5 Highlights and Step-by-step tutorial
GitLab 8.5 Highlights and Step-by-step tutorialGitLab 8.5 Highlights and Step-by-step tutorial
GitLab 8.5 Highlights and Step-by-step tutorial
 
Culture of working together with git
Culture of working together  with gitCulture of working together  with git
Culture of working together with git
 
Continuous Delivery at Snyk
Continuous Delivery at SnykContinuous Delivery at Snyk
Continuous Delivery at Snyk
 
Flex and .NET Integration
Flex and .NET IntegrationFlex and .NET Integration
Flex and .NET Integration
 
Gitlab CI/CD
Gitlab CI/CDGitlab CI/CD
Gitlab CI/CD
 
Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
 
Intro to Git for Project Managers
Intro to Git for Project ManagersIntro to Git for Project Managers
Intro to Git for Project Managers
 
Continuous Deployment of Architectural Change
Continuous Deployment of Architectural ChangeContinuous Deployment of Architectural Change
Continuous Deployment of Architectural Change
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
 
An intro to git
An intro to gitAn intro to git
An intro to git
 
PUG Romagna - Pipeline + Deployer PHP
PUG Romagna - Pipeline + Deployer PHPPUG Romagna - Pipeline + Deployer PHP
PUG Romagna - Pipeline + Deployer PHP
 
Beautiful Builds - Roy Osherove at Microsoft Swit
Beautiful Builds - Roy Osherove at Microsoft SwitBeautiful Builds - Roy Osherove at Microsoft Swit
Beautiful Builds - Roy Osherove at Microsoft Swit
 

Similar to Git - A soft introduction

Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with gitJoseluis Laso
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsGorav Singal
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Ahmed El-Arabawy
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Bruno Capuano
 
How We Use GitHub
How We Use GitHubHow We Use GitHub
How We Use GitHubNYC DevShop
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ GitheyMP
 
[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't CodeChristopher Schmitt
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlowMark Everard
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdfTilton2
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideRaghavendraVattikuti1
 
Learn Git form Beginners to Master
Learn Git form Beginners to MasterLearn Git form Beginners to Master
Learn Git form Beginners to MasterC. M. Abdullah Khan
 

Similar to Git - A soft introduction (20)

GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with git
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levels
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
 
git and github
git and githubgit and github
git and github
 
How We Use GitHub
How We Use GitHubHow We Use GitHub
How We Use GitHub
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ Git
 
[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlow
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
 
Learn Git form Beginners to Master
Learn Git form Beginners to MasterLearn Git form Beginners to Master
Learn Git form Beginners to Master
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Recently uploaded (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

Git - A soft introduction

  • 1. Git An introduction! ! Srikanth Sombhatla
  • 2. Scope • Just a soft introduction. • Introduces you to terms and best practices. • Hands-on. • But you should practice !
  • 3. Why Git “A good developer is also good at code management.” • Simple to work with. • Non linear development and distributed development. • Fast and robust. • Manages complex code merges.
  • 4. Baby steps 3 magical ways to learn git • Always use command line. • Always use command line. • Always use command line. because with GUI you never get hands-on !
  • 5. Lets speak the same language commit • A snapshot of code change. • Captures what, who and when changed. • Commit id is unique to your repository. commit 86da7a8dd0be71842744fc8aadf3dc5ced28f3dd! Author: Srikanth Sombhatla <srikanth@zippr.in>! Date: Thu Nov 6 16:02:11 2014 +0530! ! improved subscription sync. fixed issues and minor refactorings
  • 6. Lets speak the same language branch • A chain of commits. • In the context of branch of development • Topmost commit of the branch is called HEAD • Use HEAD to reset the branch incase of any issues. • You loose all your changes !! git branch! Dev! inplace_zoom! inplace_zoom_i2! perf_async_loading! * pictures! rel_indian_summer_1.8.2!
  • 7. Lets speak the same language repository • A working tree. Completely self contained. • The collection of your code and their branches. • In server this is called remote repository! • On local machine this is called local repository! • You clone a remote repository! • You init a local repository
  • 8. Lets speak the same language clone • a remote repository reflected in your local. • actually you are following that git repository.! push • All local commits uploaded to remote pull • All commits downloaded to local!
  • 9. Lets do some hands-on.
  • 10. Some useful git commands • git status • git log • git checkout -b <new branch name> • git add • git stash • git merge • git cherry-pick • git push -v origin <branch_name>
  • 11. What is a good commit? • One commit - One change. • This can have multiple files relevant to one change. • Never combine multiple irrelevant changes into one commit. • Because you cannot rollback a particular change. • Because it is difficult to do code review. • Because it is just not clean. • Your commit message should be self explanatory.
  • 12. Commit work flow • Make sure you are in the correct branch • git branch • Check status • git status • Review your changes - is this what you want to commit ? • git difftool • any standard tool like opendiff can act as git difftool • git commit • Once done these changes are committed to staging.
  • 13. Branching strategy • One feature - one branch. • Ex: pictures, performance, bugfixes etc • All code changes for this feature are confined to this branch. • You work independently. • Anytime switch to another branch. Revisit and continue your work.
  • 14. Simple Branching strategy bugfixes_1 layouts notification sync development branches QA2 QA REL1 REL2 master QA1 REL3 REL4 merging nightly builds pictures
  • 15. Release strategy • One production release - one branch. • After release freeze this branch and never push anything upstream. • Reference code in future. • Helps in applying hot fixes