SlideShare une entreprise Scribd logo
1  sur  48
Télécharger pour lire hors ligne
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.
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/

Contenu connexe

Tendances

Tendances (20)

Gittalk
GittalkGittalk
Gittalk
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
git and github
git and githubgit and github
git and github
 
Git & GitHub WorkShop
Git & GitHub WorkShopGit & GitHub WorkShop
Git & GitHub WorkShop
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
Github
GithubGithub
Github
 
Git: basic to advanced
Git: basic to advancedGit: basic to advanced
Git: basic to advanced
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
 
Git Basics - RubyFest 2009
Git Basics - RubyFest 2009Git Basics - RubyFest 2009
Git Basics - RubyFest 2009
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon Melbourne
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
 

Similaire à Git Real

The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubBigBlueHat
 
11 git version control
11 git version control11 git version control
11 git version controlWasim Alatrash
 
Git.From thorns to the stars
Git.From thorns to the starsGit.From thorns to the stars
Git.From thorns to the starsStrannik_2013
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
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
 
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...WSO2
 
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Git Is A State Of Mind - The path to becoming a Master of the mystic art of GitGit Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Git Is A State Of Mind - The path to becoming a Master of the mystic art of GitNicola Costantino
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIsTim Osborn
 
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
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Git is a distributed version control system .
Git is a distributed version control system .Git is a distributed version control system .
Git is a distributed version control system .HELLOWorld889594
 
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
 
Git hub for designers
Git hub for designersGit hub for designers
Git hub for designersFITC
 

Similaire à Git Real (20)

The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
11 git version control
11 git version control11 git version control
11 git version control
 
Git.From thorns to the stars
Git.From thorns to the starsGit.From thorns to the stars
Git.From thorns to the stars
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
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
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...Git workshop - University of Moratuwa, Department of Computer Science and Eng...
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
Git Is A State Of Mind - The path to becoming a Master of the mystic art of GitGit Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
 
Intro to Git & GitHub
Intro to Git & GitHubIntro to Git & GitHub
Intro to Git & GitHub
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
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?
 
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
GIT-FirstPart.ppt
GIT-FirstPart.pptGIT-FirstPart.ppt
GIT-FirstPart.ppt
 
Git is a distributed version control system .
Git is a distributed version control system .Git is a distributed version control system .
Git is a distributed version control system .
 
Introduction to Git (part 1)
Introduction to Git (part 1)Introduction to Git (part 1)
Introduction to Git (part 1)
 
Mastering git
Mastering gitMastering git
Mastering git
 
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
 
Git hub for designers
Git hub for designersGit hub for designers
Git hub for designers
 

Plus de Gong Haibing

Ansible Introduction
Ansible IntroductionAnsible Introduction
Ansible IntroductionGong Haibing
 
How to Code Review
How to Code ReviewHow to Code Review
How to Code ReviewGong Haibing
 
A Byte of Software Deployment
A Byte of Software DeploymentA Byte of Software Deployment
A Byte of Software DeploymentGong Haibing
 
Sponia with QingCloud
Sponia with QingCloudSponia with QingCloud
Sponia with QingCloudGong Haibing
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database FundamentalGong Haibing
 

Plus de Gong Haibing (9)

Ansible Introduction
Ansible IntroductionAnsible Introduction
Ansible Introduction
 
Nginx Essential
Nginx EssentialNginx Essential
Nginx Essential
 
How to Code Review
How to Code ReviewHow to Code Review
How to Code Review
 
A Byte of Software Deployment
A Byte of Software DeploymentA Byte of Software Deployment
A Byte of Software Deployment
 
Sponia with QingCloud
Sponia with QingCloudSponia with QingCloud
Sponia with QingCloud
 
Search Engine
Search EngineSearch Engine
Search Engine
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
 
Linux Fundamental
Linux FundamentalLinux Fundamental
Linux Fundamental
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database Fundamental
 

Dernier

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

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.
  • 42.
  • 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/