SlideShare une entreprise Scribd logo
1  sur  43
Git Intro
agenda ,[object Object]
git ,[object Object]
usage
Who is Greg? ,[object Object]
SCM??? ,[object Object]
Common starting points
Release, feature development, etc... ,[object Object],[object Object],[object Object],[object Object]
SCM Evolution tar/zip RCS SVN CVS clearcase perforce git/hg/bazaar
SCM: the new guys ,[object Object]
peer to peer architecture
atomic ”change set” based ,[object Object],[object Object],[object Object]
What is git? ,[object Object]
A tree based content management storage system ,[object Object],[object Object],[object Object]
Ported to Windows, OSX, any posix based OS
Many GUI clients
git Storage Design ,[object Object]
It's simple, based on... ,[object Object]
Database theory
Graph theory
Set theory
git storage (repository) ,[object Object]
keys are 20 byte arrays.
SHA1 algorithm – crypto algorithm ,[object Object],[object Object]
trees : directories
commit : points to a tree, and other commits
tag : points to a commit
Git: blobs #include <stdio.h> int main() { printf(“hello world”); return 0; }   Blobs: files (text and binary), symlinks
git: tree permission object hash  name 100644 blob 82354a1... README 100755 blob 02342c5... a.out 040000 tree a67ef32... 02342c... src Trees:  aka directories
git: commit date author parents comment tree Mon Dec 20 16:10:41 2010 -0700 joe developer <joe@gmail.com>  234ab23... Fixed the border defect 89023a2...
git: tag date tagger Mon Dec 20 16:10:41 2010 -0700 joe developer <joe@gmail.com>  234ab23... commit comment Release 1.0
git: repo git init echo “hello” > B1 git add B1 git commit  echo “world” > B2 git add B2 git commit  git init echo “hello” > B1 git add B1 git commit  mkdir T2 git mv B1 B2 T2 cp T2/B1 B3 git add B3 git commit Time C3 C1 C2 T1 B2 B1 T1 T2 B2 B1 T1 B1 C3 C1 C2 T2 B2 B1 T3 T2 B2 B1 T1 B1
git: repo C3 C1 C2 T1 T1 T1 B1 C3 C1 C2 T2 B2 T3 T1 B1
git : DAG ,[object Object]
git : DAG  HEAD ,[object Object]
tags : immutable (V1.0) C1 C1 C1 C2 C1 C3 C1 C6 C1 C8 C4 C5 C7 master work_br V1.0
git: DAG HEAD git init git commit C1 C1 master
git: DAG HEAD git branch work_br C1 C1 master work_br
git: DAG HEAD git commit C1 C1 C1 C2 master work_br
git: DAG HEAD git commit C1 C1 C1 C2 C1 C3 master work_br
git: DAG HEAD git checkout work_br git commit C1 C1 C1 C2 C1 C3 C4 master work_br
git: DAG HEAD git commit C1 C1 C1 C2 C1 C3 C4 C5 master work_br
git: DAG HEAD git checkout master git merge work_br C1 C1 C1 C2 C1 C3 C1 C6 C4 C5 master work_br

Contenu connexe

Tendances

Open Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubOpen Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git Hub
Nick Quaranto
 
Understanding git
Understanding gitUnderstanding git
Understanding git
Avik Das
 

Tendances (20)

Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a BossGit Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Boss
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
 
Presentacion git
Presentacion gitPresentacion git
Presentacion git
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
 
Open Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubOpen Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git Hub
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internally
 
Understanding git
Understanding gitUnderstanding git
Understanding git
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
DrupalCafe5 VCS
DrupalCafe5 VCSDrupalCafe5 VCS
DrupalCafe5 VCS
 
#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
 

En vedette

Git- Fast version control system
Git- Fast version control systemGit- Fast version control system
Git- Fast version control system
Akhil Bansal
 
SCM - More than just a version control tool!
SCM - More than just a version control tool!SCM - More than just a version control tool!
SCM - More than just a version control tool!
elliando dias
 
Introduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementIntroduction to Version Control and Configuration Management
Introduction to Version Control and Configuration Management
Philip Johnson
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration Management
Chandan Chaurasia
 

En vedette (12)

SCM: An Introduction
SCM: An IntroductionSCM: An Introduction
SCM: An Introduction
 
Git- Fast version control system
Git- Fast version control systemGit- Fast version control system
Git- Fast version control system
 
SCM - More than just a version control tool!
SCM - More than just a version control tool!SCM - More than just a version control tool!
SCM - More than just a version control tool!
 
SCM PPT
SCM PPTSCM PPT
SCM PPT
 
SCM, CI and Maven Repo
SCM, CI and Maven RepoSCM, CI and Maven Repo
SCM, CI and Maven Repo
 
Comparison of issue tracking in major SCM tools
Comparison of issue tracking in major SCM toolsComparison of issue tracking in major SCM tools
Comparison of issue tracking in major SCM tools
 
Introduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementIntroduction to Version Control and Configuration Management
Introduction to Version Control and Configuration Management
 
Introduction To Software Configuration Management
Introduction To Software Configuration ManagementIntroduction To Software Configuration Management
Introduction To Software Configuration Management
 
Configuration Management
Configuration ManagementConfiguration Management
Configuration Management
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration Management
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration Management
 
ClearCase Version Importer - a migration tool to Rational Team Concert SCM
ClearCase Version Importer - a migration tool to Rational Team Concert SCMClearCase Version Importer - a migration tool to Rational Team Concert SCM
ClearCase Version Importer - a migration tool to Rational Team Concert SCM
 

Similaire à Introduction to Git (Greg Lonnon)

Introduction of Git
Introduction of GitIntroduction of Git
Introduction of Git
Wayne Chen
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
Terry Wang
 

Similaire à Introduction to Git (Greg Lonnon) (20)

Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
M.Mozūras - git
M.Mozūras - gitM.Mozūras - git
M.Mozūras - git
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
 
Introduction to git, a version control system
Introduction to git, a version control systemIntroduction to git, a version control system
Introduction to git, a version control system
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
 
Practical git for developers
Practical git for developersPractical git for developers
Practical git for developers
 
Git and git hub
Git and git hubGit and git hub
Git and git hub
 
Effective Git with Eclipse
Effective Git with EclipseEffective Git with Eclipse
Effective Git with Eclipse
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
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
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Git - (a) Gentle InTroduction
Git - (a) Gentle InTroductionGit - (a) Gentle InTroduction
Git - (a) Gentle InTroduction
 
Introduction of Git
Introduction of GitIntroduction of Git
Introduction of Git
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Git
GitGit
Git
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Introduction to Git (Greg Lonnon)

  • 2.
  • 3.
  • 5.
  • 6.
  • 8.
  • 9. SCM Evolution tar/zip RCS SVN CVS clearcase perforce git/hg/bazaar
  • 10.
  • 11. peer to peer architecture
  • 12.
  • 13.
  • 14.
  • 15. Ported to Windows, OSX, any posix based OS
  • 17.
  • 18.
  • 22.
  • 23. keys are 20 byte arrays.
  • 24.
  • 26. commit : points to a tree, and other commits
  • 27. tag : points to a commit
  • 28. Git: blobs #include <stdio.h> int main() { printf(“hello world”); return 0; } Blobs: files (text and binary), symlinks
  • 29. git: tree permission object hash name 100644 blob 82354a1... README 100755 blob 02342c5... a.out 040000 tree a67ef32... 02342c... src Trees: aka directories
  • 30. git: commit date author parents comment tree Mon Dec 20 16:10:41 2010 -0700 joe developer <joe@gmail.com> 234ab23... Fixed the border defect 89023a2...
  • 31. git: tag date tagger Mon Dec 20 16:10:41 2010 -0700 joe developer <joe@gmail.com> 234ab23... commit comment Release 1.0
  • 32. git: repo git init echo “hello” > B1 git add B1 git commit echo “world” > B2 git add B2 git commit git init echo “hello” > B1 git add B1 git commit mkdir T2 git mv B1 B2 T2 cp T2/B1 B3 git add B3 git commit Time C3 C1 C2 T1 B2 B1 T1 T2 B2 B1 T1 B1 C3 C1 C2 T2 B2 B1 T3 T2 B2 B1 T1 B1
  • 33. git: repo C3 C1 C2 T1 T1 T1 B1 C3 C1 C2 T2 B2 T3 T1 B1
  • 34.
  • 35.
  • 36. tags : immutable (V1.0) C1 C1 C1 C2 C1 C3 C1 C6 C1 C8 C4 C5 C7 master work_br V1.0
  • 37. git: DAG HEAD git init git commit C1 C1 master
  • 38. git: DAG HEAD git branch work_br C1 C1 master work_br
  • 39. git: DAG HEAD git commit C1 C1 C1 C2 master work_br
  • 40. git: DAG HEAD git commit C1 C1 C1 C2 C1 C3 master work_br
  • 41. git: DAG HEAD git checkout work_br git commit C1 C1 C1 C2 C1 C3 C4 master work_br
  • 42. git: DAG HEAD git commit C1 C1 C1 C2 C1 C3 C4 C5 master work_br
  • 43. git: DAG HEAD git checkout master git merge work_br C1 C1 C1 C2 C1 C3 C1 C6 C4 C5 master work_br
  • 44. git: DAG HEAD git checkout work_br git commit C1 C1 C1 C2 C1 C3 C1 C6 C4 C5 C7 master work_br
  • 45. git: DAG HEAD git checkout master git commit C1 C1 C1 C2 C1 C3 C1 C6 C1 C8 C4 C5 C7 master work_br
  • 46.
  • 47.
  • 48.
  • 49. HEAD : current checkout hash
  • 50. git clone HEAD http:/github.com/<user>/<repo> origin git clone http://github.com/ <user>/<repo> local git clone copies the remote objects/references to a new repository The remote repo is nicknamed origin , a remote tracking branch is created to track origin/master local C1 C1 C2 C1 C3 C4 C5 master work_br C1 C1 C2 C1 C3 C4 C5 origin/master origin/work_br master
  • 51. git fetch HEAD HEAD git fetch origin origin local local Fetch moves C6 commit objects to the local repo, and updates the tracking branch origin/master C1 C2 C3 C4 C5 master work_br C6 C1 C2 C3 C4 C5 origin/master work_br C1 C2 C3 C4 C5 origin/master work_br C6 C7 master master origin/work_br origin/work_br
  • 52. git push git push origin origin Push local to origin. The local work_br is a proper superset of the origin work_br branch, and the origin is updated. The local master push fails, it is NOT a not a proper superset of the origin master branch origin HEAD local C1 C2 C3 C4 C5 master work_br C6 C1 C2 C3 C4 C5 master work_br C6 C7 C1 C2 C3 C4 C5 origin/master work_br C6 C7 master origin/work_br
  • 53.
  • 54.
  • 55. git merge HEAD git merge work_br HEAD Merges 1 or more branch into the current branch. C1 C1 C1 C2 C1 C3 C4 C5 master work_br C1 C1 C1 C2 C1 C3 C1 C6 C4 C5 master work_br
  • 56. git merge --squash HEAD git merge --squash work_br HEAD Merges a branch, but does not track the merge. Useful in large repositories with a lot of activity. C1 C1 C1 C2 C1 C3 C4 C5 master work_br C1 C1 C1 C2 C1 C3 C1 C6 C4 C5 master work_br
  • 57. git cherry-pick HEAD git cherry-pick C5 HEAD Calculates and applies the file changes of a commit. Useful for moving changes between a release branch and main development C1 C1 C1 C2 C1 C3 C4 C5 master work_br C1 C1 C1 C2 C1 C3 C4 C5 work_br C5' master
  • 58. git rebase HEAD git rebase master HEAD Moves a “family” of commits to a new “base” Useful for developers to “refresh” their branch. C1 C1 C1 C2 C1 C3 C4 C5 master work_br C1 C1 C1 C2 C1 C3 C4 C5 master work_br C4' C5'
  • 59. git rebase: a closer look HEAD Step 1: Apply d1 to C3 Step 2: Apply d2 to C4' C1 C1 C1 C2 C1 C3 C4 C5 master work_br C4' C5' d1 d2 d1 d2
  • 60.
  • 61.
  • 63. Use them for scripting git
  • 65. gitk
  • 67.
  • 68. Use commits to separate out features, debug, temporary work, etc...
  • 69. git != svn, don't treat it like svn...
  • 70.
  • 71.
  • 72.
  • 73.