SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Kürzlich hochgeladen (20)

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...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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?
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

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.