SlideShare a Scribd company logo
Git Real
@dylanninin
• What is Git
• Internals
• Play with Git
• Workflow
• Q&A
What is Git
A long time ago
SCM Timeline
Git != Subversion + Magic!
Git != Subversion + Magic!
- Git is a stupid content tracker.

- It is simply used as an SCM, not really designed as one. 

- In many ways you can just see git as a file system
“In many ways you can just see git as a file system — it’s content- addressable,
and it has a notion of versioning, but I really really designed it coming at the
problem from the viewpoint of a file system person (hey, kernels is what I do),
and I actually have absolutely zero interest in creating a traditional SCM
system.”
– Linus (http://marc.info/?l=linux-kernel&m=111314792424707)
Git Design
• Non-Linear Development
• Distributed Development
• Efficiency
Git Internals
Internals - The Model
Internals - Git Objects
• Git objects are the actual data of Git, the main thing that the repository is made up of
• Each object is compressed (with Zlib) and referenced by the SHA-1 value of its contents
plus a small header:
• full SHA-1: dae86e1950b1277e545cee180551750029cfe735
• partial SHA-1: dae86e 

• There are four main object types in Git:
• Blob
• Tree
• Commit
• Tag
Internals - Working Directory
The Blob
The Blob
The Tree
The Tree
The Commit
The Commit
The Tag
Internals - Example
• current repository with one commit
• and its’ logical structure
Internals - Example
• modify lib/base/base_include.rb
• add a release tag v0.1
Internals - Example
• modify init.rb
Internals - Example
• history view
Internals - Example
• git checkout v0.1
Internals - Branching and Merging
• Branches resident in .git/ refs/heads
• Creating a branch is nothing more than just writing 40 characters to a file
Internals - Remotes
• origin/master
• local master
Internals - Remotes
• origin/master
• origin/idea
• local master
Internals - Merge
• local master
• tag T1
• feature branch experiment
Internals - Merge
• merge experiment into master
• delete experiment branch
Internals - Rebase
• commits, pull and merge
• history becomes worse and confusing
Internals - Rebase
• orphans Commit 1
• applies the changes between Commit 0 and Commit 1 to the files in Remote Commit 1
• creating a new Commit 2
Internals - Rebase
• as you’ll remember, you and Jen both commit again
Internals - Rebase
• rebase next two commits
Internals - Rebase
• rebase next two commits
Internals - Rebase
• rebase with linear history
• merge sucks a lot
Play with Git
Play with Git - config
• git config —global user.name “Dylan”
• git config —global user.email “dylanninin@gmail.com
Or
[user]
name = Dylan
email = dylanninin@gmail.com
[core]
excludesfile = ~/.gitignore
editor = vim
[alias]
co = checkout
[log]
date = relative
More such example
• https://gist.github.com/pksunkara/988716
• ~/.gitconfig
Play with Git - .git directory
http://www.gitguys.com/topics/the-git-directory/
Play with Git - model
• repository/remote/workspace
• index area
Play with Git - work hard
http://www.gitguys.com/topics/the-git-directory/
Play with Git - help
• git help <command>|<concept>
• git help -a
• git help -g
The common Git guides are:
attributes Defining attributes per path
everyday Everyday Git With 20 Commands Or So
glossary A Git glossary
ignore Specifies intentionally untracked files to ignore
modules Defining submodule properties
revisions Specifying revisions and ranges for Git
tutorial A tutorial introduction to Git (for version 1.5.1 or newer)
workflows An overview of recommended workflows with Git
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
Git Real
Workflow
Git-flow
Github Flow
create a

branch
add 

commits
open a

pull
request
discuss
&

review
deploy
merge

into

master
In case of fire
Q & A
Reference
• Git: https://en.wikipedia.org/wiki/Git_(software)
• Linus on Git: https://www.youtube.com/watch?v=4XpnKHJAok8
• Pro Git: http://git-scm.com/book
• Git Internals: http://git-scm.com/book/en/v1/Git-Internals
• Peepcode Git Internals: https://github.com/pluralsight/git-internals-pdf
• SHA-1: https://en.wikipedia.org/wiki/SHA-1
• Facebook’s git repo is 54GB: https://news.ycombinator.com/item?id=7648237
• Git Branching model: http://nvie.com/posts/a-successful-git-branching-model/
• Github Flow: 

- http://scottchacon.com/2011/08/31/github-flow.html

- https://guides.github.com/introduction/flow/

More Related Content

PDF
My Notes from https://www.codeschool.com/courses/git-real
PDF
Git real slides
PPTX
PDF
Git - Get Ready To Use It
PDF
Git & GitHub for Beginners
DOCX
Bitbucket
ODP
The Fundamentals of Git
KEY
The everyday developer's guide to version control with Git
My Notes from https://www.codeschool.com/courses/git-real
Git real slides
Git - Get Ready To Use It
Git & GitHub for Beginners
Bitbucket
The Fundamentals of Git
The everyday developer's guide to version control with Git

What's hot (20)

KEY
Gittalk
PPTX
Git and GitHub
PDF
git and github
PDF
Git & GitHub WorkShop
PDF
Advanced Git Tutorial
KEY
Matt Gauger - Git & Github web414 December 2010
PDF
Git & Github for beginners
PPTX
PDF
Git: basic to advanced
PPT
Learn Git Basics
PPTX
Grokking opensource with github
KEY
Git Basics - RubyFest 2009
PDF
Introducción a git y GitHub
PDF
Github - Le Wagon Melbourne
KEY
Git Basics at Rails Underground
PPT
Git Introduction
PDF
Intro to Git and GitHub
PPTX
Advanced Git Presentation By Swawibe
PDF
Inside GitHub with Chris Wanstrath
PPTX
Git-ing out of your git messes
Gittalk
Git and GitHub
git and github
Git & GitHub WorkShop
Advanced Git Tutorial
Matt Gauger - Git & Github web414 December 2010
Git & Github for beginners
Git: basic to advanced
Learn Git Basics
Grokking opensource with github
Git Basics - RubyFest 2009
Introducción a git y GitHub
Github - Le Wagon Melbourne
Git Basics at Rails Underground
Git Introduction
Intro to Git and GitHub
Advanced Git Presentation By Swawibe
Inside GitHub with Chris Wanstrath
Git-ing out of your git messes
Ad

Similar to Git Real (20)

PDF
The Basics of Open Source Collaboration With Git and GitHub
PPTX
11 git version control
PPTX
Git.From thorns to the stars
PPTX
Git One Day Training Notes
PPTX
Learn Git - For Beginners and Intermediate levels
PPT
Fundamentals and basics of Git and commands
PPT
Introduction to git
PPTX
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
PDF
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
PDF
Intro to Git & GitHub
PDF
Git for folk who like GUIs
PPTX
Que nos espera a los ALM Dudes para el 2013?
PDF
Mini git tutorial
PPT
Git installation and configuration
PPT
GIT-FirstPart.ppt
PPT
Git is a distributed version control system .
PDF
Introduction to Git (part 1)
PPTX
Mastering git
PPTX
GitHub_Sharing_Session_1_GitHub_Sharing_Session.pptx
ZIP
Beginner's Guide to Version Control with Git
The Basics of Open Source Collaboration With Git and GitHub
11 git version control
Git.From thorns to the stars
Git One Day Training Notes
Learn Git - For Beginners and Intermediate levels
Fundamentals and basics of Git and commands
Introduction to git
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Intro to Git & GitHub
Git for folk who like GUIs
Que nos espera a los ALM Dudes para el 2013?
Mini git tutorial
Git installation and configuration
GIT-FirstPart.ppt
Git is a distributed version control system .
Introduction to Git (part 1)
Mastering git
GitHub_Sharing_Session_1_GitHub_Sharing_Session.pptx
Beginner's Guide to Version Control with Git
Ad

More from Gong Haibing (9)

PDF
Ansible Introduction
PDF
Nginx Essential
PDF
How to Code Review
PDF
A Byte of Software Deployment
PDF
Sponia with QingCloud
PDF
Search Engine
PDF
Jenkins-CI
PDF
Linux Fundamental
PDF
Database Fundamental
Ansible Introduction
Nginx Essential
How to Code Review
A Byte of Software Deployment
Sponia with QingCloud
Search Engine
Jenkins-CI
Linux Fundamental
Database Fundamental

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
KodekX | Application Modernization Development
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
cuic standard and advanced reporting.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Mobile App Security Testing_ A Comprehensive Guide.pdf
MYSQL Presentation for SQL database connectivity
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...
Spectral efficient network and resource selection model in 5G networks
Chapter 3 Spatial Domain Image Processing.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation theory and applications.pdf
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The AUB Centre for AI in Media Proposal.docx
KodekX | Application Modernization Development
sap open course for s4hana steps from ECC to s4
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Approach and Philosophy of On baking technology
Programs and apps: productivity, graphics, security and other tools
20250228 LYD VKU AI Blended-Learning.pptx

Git Real

  • 2. • What is Git • Internals • Play with Git • Workflow • Q&A
  • 6. Git != Subversion + Magic!
  • 7. Git != Subversion + Magic! - Git is a stupid content tracker.
 - It is simply used as an SCM, not really designed as one. 
 - In many ways you can just see git as a file system “In many ways you can just see git as a file system — it’s content- addressable, and it has a notion of versioning, but I really really designed it coming at the problem from the viewpoint of a file system person (hey, kernels is what I do), and I actually have absolutely zero interest in creating a traditional SCM system.” – Linus (http://marc.info/?l=linux-kernel&m=111314792424707)
  • 8. Git Design • Non-Linear Development • Distributed Development • Efficiency
  • 11. Internals - Git Objects • Git objects are the actual data of Git, the main thing that the repository is made up of • Each object is compressed (with Zlib) and referenced by the SHA-1 value of its contents plus a small header: • full SHA-1: dae86e1950b1277e545cee180551750029cfe735 • partial SHA-1: dae86e 
 • There are four main object types in Git: • Blob • Tree • Commit • Tag
  • 12. Internals - Working Directory
  • 20. Internals - Example • current repository with one commit • and its’ logical structure
  • 21. Internals - Example • modify lib/base/base_include.rb • add a release tag v0.1
  • 22. Internals - Example • modify init.rb
  • 23. Internals - Example • history view
  • 24. Internals - Example • git checkout v0.1
  • 25. Internals - Branching and Merging • Branches resident in .git/ refs/heads • Creating a branch is nothing more than just writing 40 characters to a file
  • 26. Internals - Remotes • origin/master • local master
  • 27. Internals - Remotes • origin/master • origin/idea • local master
  • 28. Internals - Merge • local master • tag T1 • feature branch experiment
  • 29. Internals - Merge • merge experiment into master • delete experiment branch
  • 30. Internals - Rebase • commits, pull and merge • history becomes worse and confusing
  • 31. Internals - Rebase • orphans Commit 1 • applies the changes between Commit 0 and Commit 1 to the files in Remote Commit 1 • creating a new Commit 2
  • 32. Internals - Rebase • as you’ll remember, you and Jen both commit again
  • 33. Internals - Rebase • rebase next two commits
  • 34. Internals - Rebase • rebase next two commits
  • 35. Internals - Rebase • rebase with linear history • merge sucks a lot
  • 37. Play with Git - config • git config —global user.name “Dylan” • git config —global user.email “dylanninin@gmail.com Or [user] name = Dylan email = dylanninin@gmail.com [core] excludesfile = ~/.gitignore editor = vim [alias] co = checkout [log] date = relative More such example • https://gist.github.com/pksunkara/988716 • ~/.gitconfig
  • 38. Play with Git - .git directory http://www.gitguys.com/topics/the-git-directory/
  • 39. Play with Git - model • repository/remote/workspace • index area
  • 40. Play with Git - work hard http://www.gitguys.com/topics/the-git-directory/
  • 41. Play with Git - help • git help <command>|<concept> • git help -a • git help -g The common Git guides are: attributes Defining attributes per path everyday Everyday Git With 20 Commands Or So glossary A Git glossary ignore Specifies intentionally untracked files to ignore modules Defining submodule properties revisions Specifying revisions and ranges for Git tutorial A tutorial introduction to Git (for version 1.5.1 or newer) workflows An overview of recommended workflows with Git 'git help -a' and 'git help -g' list available subcommands and some concept guides. See 'git help <command>' or 'git help <concept>' to read about a specific subcommand or concept.
  • 45. Github Flow create a
 branch add 
 commits open a
 pull request discuss &
 review deploy merge
 into
 master
  • 46. In case of fire
  • 47. Q & A
  • 48. Reference • Git: https://en.wikipedia.org/wiki/Git_(software) • Linus on Git: https://www.youtube.com/watch?v=4XpnKHJAok8 • Pro Git: http://git-scm.com/book • Git Internals: http://git-scm.com/book/en/v1/Git-Internals • Peepcode Git Internals: https://github.com/pluralsight/git-internals-pdf • SHA-1: https://en.wikipedia.org/wiki/SHA-1 • Facebook’s git repo is 54GB: https://news.ycombinator.com/item?id=7648237 • Git Branching model: http://nvie.com/posts/a-successful-git-branching-model/ • Github Flow: 
 - http://scottchacon.com/2011/08/31/github-flow.html
 - https://guides.github.com/introduction/flow/