SlideShare a Scribd company logo
The Nits and Grits of Git
How Git really works
Ryan Michela - Salesforce
Agenda
1. Git history
2. Objects, Trees and Commits
3. Refs and Branches
4. Merging
Assumption: You are already familiar with normal Git
workflow
A brief history of Git
Launched in 2005
Built by the Linux kernel team
Started by Linus Torvalds
2014 - More Git than SVN
2016 - 38+ Million Github repos
The most common commands
git add
git status
git commit
git branch
git merge
Git objects
Content addressable filesystem
Every object known by a SHA1 hash
All objects stored in the .git directory
Demo...
Tree objects
Connect objects to the filesystem
Tree = directory
Object = file content
Git index
State of the repo
right now
Demo...
Commands so far
git add
git hash-object -w
git update-index
git write-tree
git status
git cat-file
git ls-files -s
Commit objects
Snapshots of trees
Explains who/when/why
History of code
Demo...
References
Named pointers to commit SHA1 - Branches
.git/refs/heads/master
HEAD
Demo...
Commands so far
git add
git hash-object -w
git update-index
git write-tree
git status
git cat-file
git ls-files -s
git commit
git commit-tree
git update-ref
Merging
Joins branches back together
A commit with one or more parents
Merges parent trees together into one
Demo...
Commands so far
git add
git hash-object -w
git update-index
git write-tree
git status
git cat-file
git ls-files -s
git commit
git commit-tree
git update-ref
git merge
git symbolic-ref
git commit-tree -p
The heart of Git
Content addressable filesystem
Three principal data structures
Object
Tree
Commit
Heaps of magic
Questions?
Resources
Commands used in this presentation
Pro Git book
All Git commands
Legal Stuff
All presentation content is licensed under the Creative Commons Attribution
Noncommercial Share Alike 3.0 (CC BY-NC-SA 3.0) license
Some images used from Pro Git Second Edition by Scott Chacon and Ben
Straub licensed under CC BY-NC-SA 3.0
Git logo licensed under Creative Commons Attribution 3.0 (CC BY 3.0)
Wizard hat image under public domain from Wikipedia

More Related Content

PPTX
KI University - Git internals
PDF
Introducing Wordpress Multitenancy
PPTX
Different Conflict Management Types
PPTX
Insight_Session_2734_Presentation_Final
DOCX
Quy tắc đặt dấu thanh trong chữ quốc ngữ
PDF
Sprig health campaign1
PDF
Infantry Bugler NW Article by Sears
PDF
Kickoffreiseliv2016 Mat og drikke som viktige kulturbærere
KI University - Git internals
Introducing Wordpress Multitenancy
Different Conflict Management Types
Insight_Session_2734_Presentation_Final
Quy tắc đặt dấu thanh trong chữ quốc ngữ
Sprig health campaign1
Infantry Bugler NW Article by Sears
Kickoffreiseliv2016 Mat og drikke som viktige kulturbærere

Viewers also liked (19)

DOCX
Mradul Agrawal - C.V.(M.B.A. With 6.5 Yr Exp)
PDF
Newsletter ONEgas
PPTX
Product Strategy
PPTX
Asset Protection Planning Strategies
PDF
TMP General Marketing Brochure 2016 - Copy
PDF
Conducir el cambio con creatividad
PDF
Frame shift schedule
PPTX
світ барвистий , веселковий,2012
PPTX
PPTX
How Developers and Quality Engineer Collaborate at Salesforce
PPTX
Chính sách kinh tế vĩ mô singapore 2013-2015
PDF
2015 Fuzzy Vance Lecture in Mathematics at Oberlin College: Locating and disp...
PPTX
Visita a los gigantes de burlada
PPTX
Ver r 2015 clinical reviews amelia island (1)
PPTX
Work Global, Live Local
PPTX
Fre 2015 webinar
PPTX
Emergency Medicine Events Register
ODP
La llegenda de Sant Jordi
Mradul Agrawal - C.V.(M.B.A. With 6.5 Yr Exp)
Newsletter ONEgas
Product Strategy
Asset Protection Planning Strategies
TMP General Marketing Brochure 2016 - Copy
Conducir el cambio con creatividad
Frame shift schedule
світ барвистий , веселковий,2012
How Developers and Quality Engineer Collaborate at Salesforce
Chính sách kinh tế vĩ mô singapore 2013-2015
2015 Fuzzy Vance Lecture in Mathematics at Oberlin College: Locating and disp...
Visita a los gigantes de burlada
Ver r 2015 clinical reviews amelia island (1)
Work Global, Live Local
Fre 2015 webinar
Emergency Medicine Events Register
La llegenda de Sant Jordi
Ad

Similar to The Nits and Grits of Git (20)

PPTX
Demystifying git
PPTX
How git works
PPTX
Roslyn on GitHub
PDF
Version control with GIT
PPTX
Git workshop 33degree 2011 krakow
PPTX
Github Session organized by GDG on campus SCOE.pptx
PDF
Advanced git
PPTX
Git 101 for Beginners
PPTX
Workshop on git
PDF
Git: An introduction of plumbing and porcelain commands
PDF
Git session-2012-2013
PPT
Git, Fast and Distributed Source Code Management
PDF
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
PDF
Understanding GIT
PPTX
Getting Started with Git: A Primer for SVN and TFS Users
PPTX
Introduction to Git and Github
PDF
Git (FS and DVCS)
PPTX
Git - Basic Crash Course
PDF
Learning git
PPT
GIT-FirstPart.ppt
Demystifying git
How git works
Roslyn on GitHub
Version control with GIT
Git workshop 33degree 2011 krakow
Github Session organized by GDG on campus SCOE.pptx
Advanced git
Git 101 for Beginners
Workshop on git
Git: An introduction of plumbing and porcelain commands
Git session-2012-2013
Git, Fast and Distributed Source Code Management
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
Understanding GIT
Getting Started with Git: A Primer for SVN and TFS Users
Introduction to Git and Github
Git (FS and DVCS)
Git - Basic Crash Course
Learning git
GIT-FirstPart.ppt
Ad

More from Salesforce Engineering (20)

PPTX
Locker Service Ready Lightning Components With Webpack
PPTX
Scaling HBase for Big Data
PPTX
Techniques to Effectively Monitor the Performance of Customers in the Cloud
PPTX
Predictive System Performance Data Analysis
PPTX
Apache HBase State of the Project
PPTX
Hit the Trail with Trailhead
PPTX
HBase/PHOENIX @ Scale
PPTX
Scaling up data science applications
PPTX
Containers and Security for DevOps
PPTX
Aspect Oriented Programming: Hidden Toolkit That You Already Have
PPTX
Monitoring @ Scale in Salesforce
PPTX
Performance Tuning with XHProf
PPTX
A Smarter Pig: Building a SQL interface to Pig using Apache Calcite
PPTX
Implementing a Content Strategy Is Like Running 100 Miles
PPTX
Salesforce Cloud Infrastructure and Challenges - A Brief Overview
PDF
Koober Preduction IO Presentation
PPTX
Finding Security Issues Fast!
PDF
Microservices
PPTX
Global State Management of Micro Services
PPTX
The Future of Hbase
Locker Service Ready Lightning Components With Webpack
Scaling HBase for Big Data
Techniques to Effectively Monitor the Performance of Customers in the Cloud
Predictive System Performance Data Analysis
Apache HBase State of the Project
Hit the Trail with Trailhead
HBase/PHOENIX @ Scale
Scaling up data science applications
Containers and Security for DevOps
Aspect Oriented Programming: Hidden Toolkit That You Already Have
Monitoring @ Scale in Salesforce
Performance Tuning with XHProf
A Smarter Pig: Building a SQL interface to Pig using Apache Calcite
Implementing a Content Strategy Is Like Running 100 Miles
Salesforce Cloud Infrastructure and Challenges - A Brief Overview
Koober Preduction IO Presentation
Finding Security Issues Fast!
Microservices
Global State Management of Micro Services
The Future of Hbase

Recently uploaded (20)

PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
composite construction of structures.pdf
PPTX
Sustainable Sites - Green Building Construction
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
737-MAX_SRG.pdf student reference guides
PPT
Mechanical Engineering MATERIALS Selection
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Current and future trends in Computer Vision.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
DOCX
573137875-Attendance-Management-System-original
PPTX
Construction Project Organization Group 2.pptx
UNIT 4 Total Quality Management .pptx
Fundamentals of safety and accident prevention -final (1).pptx
Internet of Things (IOT) - A guide to understanding
Operating System & Kernel Study Guide-1 - converted.pdf
Model Code of Practice - Construction Work - 21102022 .pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
composite construction of structures.pdf
Sustainable Sites - Green Building Construction
Safety Seminar civil to be ensured for safe working.
Foundation to blockchain - A guide to Blockchain Tech
737-MAX_SRG.pdf student reference guides
Mechanical Engineering MATERIALS Selection
OOP with Java - Java Introduction (Basics)
Embodied AI: Ushering in the Next Era of Intelligent Systems
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Current and future trends in Computer Vision.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
573137875-Attendance-Management-System-original
Construction Project Organization Group 2.pptx

The Nits and Grits of Git

  • 1. The Nits and Grits of Git How Git really works Ryan Michela - Salesforce
  • 2. Agenda 1. Git history 2. Objects, Trees and Commits 3. Refs and Branches 4. Merging Assumption: You are already familiar with normal Git workflow
  • 3. A brief history of Git Launched in 2005 Built by the Linux kernel team Started by Linus Torvalds 2014 - More Git than SVN 2016 - 38+ Million Github repos
  • 4. The most common commands git add git status git commit git branch git merge
  • 5. Git objects Content addressable filesystem Every object known by a SHA1 hash All objects stored in the .git directory Demo...
  • 6. Tree objects Connect objects to the filesystem Tree = directory Object = file content Git index State of the repo right now Demo...
  • 7. Commands so far git add git hash-object -w git update-index git write-tree git status git cat-file git ls-files -s
  • 8. Commit objects Snapshots of trees Explains who/when/why History of code Demo...
  • 9. References Named pointers to commit SHA1 - Branches .git/refs/heads/master HEAD Demo...
  • 10. Commands so far git add git hash-object -w git update-index git write-tree git status git cat-file git ls-files -s git commit git commit-tree git update-ref
  • 11. Merging Joins branches back together A commit with one or more parents Merges parent trees together into one Demo...
  • 12. Commands so far git add git hash-object -w git update-index git write-tree git status git cat-file git ls-files -s git commit git commit-tree git update-ref git merge git symbolic-ref git commit-tree -p
  • 13. The heart of Git Content addressable filesystem Three principal data structures Object Tree Commit Heaps of magic
  • 15. Resources Commands used in this presentation Pro Git book All Git commands
  • 16. Legal Stuff All presentation content is licensed under the Creative Commons Attribution Noncommercial Share Alike 3.0 (CC BY-NC-SA 3.0) license Some images used from Pro Git Second Edition by Scott Chacon and Ben Straub licensed under CC BY-NC-SA 3.0 Git logo licensed under Creative Commons Attribution 3.0 (CC BY 3.0) Wizard hat image under public domain from Wikipedia