Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GIT

bluekw810388
October 21, 2011

 GIT

indroduction

bluekw810388

October 21, 2011
Tweet

Other Decks in Education

Transcript

  1. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min
  2. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 2m This Slide 10% 4 min
  3. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 2m Who is Scott? 10% 4 min
  4. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 75% 35 min 3m What is Git?
  5. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 75% 35 min 20m How Does Git Work?
  6. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 75% 35 min 12m How Do I Use Git?
  7. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 4m How Do I Deploy with Git? 15% 6 min
  8. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 2m Where Can I Learn More? 15% 6 min
  9. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 2m Who is Scott? 10% 4 min
  10. me

  11. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 75% 35 min 3m What is Git?
  12. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  13. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  14. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  15. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  16. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  17. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  18. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  19. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  20. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  21. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  22. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  23. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  24. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  25. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  26. source control taxonomy delta storage file A !1 file B

    file C C1 C2 C3 C4 C5 !2 !1 !2 !1 !2 !3 A B C C1 C2 C3 C4 C5 A1 B C1 A1 B C2 A2 B1 C2 A2 B2 C3 DAG storage
  27. svn cvs git perforce mercurial time machine cp -r rcs

    source control taxonomy darcs delta storage DAG storage bazzar bitkeeper local centralized distributed local centralized distributed source control taxonomy
  28. svn cvs git perforce mercurial time machine cp -r rcs

    source control taxonomy darcs delta storage DAG storage bazzar bitkeeper local centralized distributed local centralized distributed source control taxonomy
  29. svn cvs git perforce mercurial time machine cp -r rcs

    source control taxonomy darcs delta storage DAG storage bazzar bitkeeper local centralized distributed local centralized distributed source control taxonomy
  30. svn cvs git perforce mercurial time machine cp -r rcs

    source control taxonomy darcs delta storage DAG storage bazzar bitkeeper local centralized distributed local centralized distributed source control taxonomy
  31. svn cvs git perforce mercurial time machine cp -r rcs

    source control taxonomy darcs delta storage DAG storage bazzar bitkeeper local centralized distributed local centralized distributed source control taxonomy
  32. svn cvs git perforce mercurial time machine cp -r rcs

    source control taxonomy darcs delta storage DAG storage bazzar bitkeeper local centralized distributed local centralized distributed source control taxonomy
  33. svn cvs git perforce mercurial time machine cp -r rcs

    source control taxonomy darcs delta storage DAG storage bazzar bitkeeper local centralized distributed local centralized distributed source control taxonomy
  34. svn cvs git perforce mercurial time machine cp -r rcs

    source control taxonomy darcs delta storage DAG storage bazzar bitkeeper local centralized distributed local centralized distributed source control taxonomy
  35. svn cvs git perforce mercurial time machine cp -r rcs

    source control taxonomy darcs delta storage DAG storage bazzar bitkeeper local centralized distributed local centralized distributed source control taxonomy bazaar
  36. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 75% 35 min 20m How Does Git Work?
  37. git

  38. object database new_content = type + ’ ‘ + content.size

    + \0 + content sha = Digest::SHA1.hexdigest(new_content) content
  39. object database new_content = type + ’ ‘ + content.size

    + \0 + content sha = Digest::SHA1.hexdigest(new_content) content “824aed035c0aa75d64c...”
  40. object database new_content = type + ’ ‘ + content.size

    + \0 + content compressed = zlib::deflate(new_content) sha = Digest::SHA1.hexdigest(new_content) content “824aed035c0aa75d64c...”
  41. object database new_content = type + ’ ‘ + content.size

    + \0 + content compressed = zlib::deflate(new_content) sha = Digest::SHA1.hexdigest(new_content) content “824aed035c0aa75d64c...” path = “.git/objects/82/4aed035c0aa75d64c...”
  42. object database new_content = type + ’ ‘ + content.size

    + \0 + content compressed = zlib::deflate(new_content) sha = Digest::SHA1.hexdigest(new_content) content “824aed035c0aa75d64c...” path = “.git/objects/82/4aed035c0aa75d64c...” File.open(path, ‘w’) {|f| f.write(compressed)}
  43. object database new_content = type + ’ ‘ + content.size

    + \0 + content compressed = zlib::deflate(new_content) sha = Digest::SHA1.hexdigest(new_content) content “824aed035c0aa75d64c...” path = “.git/objects/82/4aed035c0aa75d64c...” File.open(path, ‘w’) {|f| f.write(compressed)} “loose” format
  44. object database new_content = type + ’ ‘ + content.size

    + \0 + content 4 types of git objects
  45. Rakele README simplegit.rb ./ lib/ blob : a874b7 blob :

    a906cb blob : a0a60a Working Directory Git Directory object database blob
  46. object database { SimpleGit Ruby Library ====================== This library calls

    git commands and returns the output. Author : Scott Chacon blob [content size]\0 Zlib::Inflate blob : a906cb zlib::deflate
  47. object database { SimpleGit Ruby Library ====================== This library calls

    git commands and returns the output. Author : Scott Chacon blob [content size]\0 Zlib::Inflate blob : a906cb content zlib::deflate
  48. object database { SimpleGit Ruby Library ====================== This library calls

    git commands and returns the output. Author : Scott Chacon blob [content size]\0 Zlib::Inflate blob : a906cb content header zlib::deflate
  49. object database { SimpleGit Ruby Library ====================== This library calls

    git commands and returns the output. Author : Scott Chacon blob [content size]\0 Zlib::Inflate blob : a906cb content header compress zlib::deflate
  50. object database { SimpleGit Ruby Library ====================== This library calls

    git commands and returns the output. Author : Scott Chacon blob [content size]\0 Zlib::Inflate blob : a906cb content header compress object zlib::deflate
  51. object database tree Rakele README simplegit.rb ./ lib/ blob :

    a874b7 blob : a906cb blob : a0a60a Working Directory Git Directory
  52. object database tree Rakele README simplegit.rb ./ lib/ tree :

    1a738d tree : fe8971 Working Directory Git Directory blob : a874b7 blob : a906cb blob : a0a60a
  53. object database { 100644 blob a906cb README 100644 blob a874b7

    Rakefile 040000 tree fe8971 lib tree [content size]\0 tree : 1a738d Zlib::Inflate zlib::deflate
  54. object database { 100644 blob a906cb README 100644 blob a874b7

    Rakefile 040000 tree fe8971 lib tree [content size]\0 tree : 1a738d Zlib::Inflate filename “inode” info zlib::deflate
  55. object database { 100644 blob a906cb README 100644 blob a874b7

    Rakefile 040000 tree fe8971 lib tree [content size]\0 tree : 1a738d Zlib::Inflate “block pointer” type mode zlib::deflate
  56. object database { Zlib::Inflate tree e1b3ec parent a11bef author Scott

    Chacon <[email protected]> 1205624433 committer Scott Chacon <[email protected]> 1205624433 my second commit, which is better than the first commit [content size]\0 commit : e1b3ec zlib::deflate
  57. object database { Zlib::Inflate tree e1b3ec parent a11bef author Scott

    Chacon <[email protected]> 1205624433 committer Scott Chacon <[email protected]> 1205624433 my second commit, which is better than the first commit [content size]\0 commit : e1b3ec zlib::deflate
  58. object database { Zlib::Inflate tree e1b3ec parent a11bef author Scott

    Chacon <[email protected]> 1205624433 committer Scott Chacon <[email protected]> 1205624433 my second commit, which is better than the first commit [content size]\0 commit : e1b3ec zlib::deflate
  59. object database { Zlib::Inflate tree e1b3ec parent a11bef author Scott

    Chacon <[email protected]> 1205624433 committer Scott Chacon <[email protected]> 1205624433 my second commit, which is better than the first commit [content size]\0 commit : e1b3ec zlib::deflate
  60. object database { Zlib::Inflate tree e1b3ec parent a11bef author Scott

    Chacon <[email protected]> 1205624433 committer Scott Chacon <[email protected]> 1205624433 my second commit, which is better than the first commit [content size]\0 commit : e1b3ec zlib::deflate
  61. object database { Zlib::Inflate object 0576fa type commit tag v0.1

    tagger Scott Chacon <[email protected]> 1205624655 this is my v0.1 tag tag [content size]\0 tag : 0c819c zlib::deflate
  62. object database { Zlib::Inflate object 0576fa type commit tag v0.1

    tagger Scott Chacon <[email protected]> 1205624655 this is my v0.1 tag tag [content size]\0 tag : 0c819c zlib::deflate
  63. object database { Zlib::Inflate object 0576fa type commit tag v0.1

    tagger Scott Chacon <[email protected]> 1205624655 this is my v0.1 tag tag [content size]\0 tag : 0c819c zlib::deflate
  64. object database { Zlib::Inflate object 0576fa type commit tag v0.1

    tagger Scott Chacon <[email protected]> 1205624655 this is my v0.1 tag tag [content size]\0 tag : 0c819c zlib::deflate
  65. object database { Zlib::Inflate object 0576fa type commit tag v0.1

    tagger Scott Chacon <[email protected]> 1205624655 this is my v0.1 tag tag [content size]\0 tag : 0c819c zlib::deflate
  66. blob branch HEAD commit remote tree tag references lightweight, movable

    pointers to a commit stored in .git/refs/* as simple files
  67. commit tag tree blob tree tree commit tree blob tree

    tree blob commit tree blob blob branch HEAD
  68. commit tag tree blob tree tree commit tree blob tree

    tree blob commit tree blob blob branch HEAD
  69. commit tag tree blob tree tree commit tree blob tree

    tree blob commit tree blob blob branch HEAD
  70. commit tag tree blob tree tree commit tree blob tree

    tree blob commit tree blob blob branch HEAD
  71. commit tag tree blob tree tree commit tree blob tree

    tree blob commit tree blob blob branch HEAD
  72. commit tag tree blob tree tree commit tree blob tree

    tree blob commit tree blob blob branch HEAD
  73. commit : a11bef tag : 0c819c tree : 1a738d tree

    : fe8971 blob : a874b7 blob : a906cb blob : a0a60a README Rakefile lib simplegit.rb $ git checkout v0.1 .git/refs/tags/v0.1 "0c819c" 1 2 3
  74. commit : a11bef tag : 0c819c tree : 1a738d tree

    : fe8971 blob : a874b7 blob : a906cb blob : a0a60a README Rakefile lib simplegit.rb $ git checkout v0.1 .git/refs/tags/v0.1 "0c819c" 1 2 3
  75. commit : a11bef tag : 0c819c tree : 1a738d tree

    : fe8971 blob : a874b7 blob : a906cb blob : a0a60a README Rakefile lib simplegit.rb $ git checkout v0.1 .git/refs/tags/v0.1 "0c819c" 1 2 3
  76. commit : a11bef tag : 0c819c tree : 1a738d tree

    : fe8971 blob : a874b7 blob : a906cb blob : a0a60a README Rakefile lib simplegit.rb $ git checkout v0.1 .git/refs/tags/v0.1 "0c819c" 1 2 3
  77. commit : a11bef tag : 0c819c tree : 1a738d tree

    : fe8971 blob : a874b7 blob : a906cb blob : a0a60a README Rakefile lib simplegit.rb $ git checkout v0.1 .git/refs/tags/v0.1 "0c819c" 1 2 3
  78. C1 master C0 C2 C3 experiment C3 C4 experiment C5

    git checkout -b experiment HEAD
  79. C1 master C0 C2 C3 experiment master 2 C3 C4

    experiment C5 T1 git commit HEAD
  80. C1 master C0 C2 C3 experiment C1 master C2 C3

    C4 experiment C5 T1 git commit git commit HEAD
  81. C1 master C0 C2 C3 experiment C1 master C2 C3

    C4 experiment C5 T1 HEAD git checkout master
  82. C1 master C0 C2 C3 C4 experiment C5 T1 C1

    master C2 C3 C4 experiment C5 T1 git commit HEAD
  83. C1 master C0 C2 C3 C4 experiment C5 T1 C1

    master C2 C3 C4 experiment C5 T1 git tag -a ‘v1.1’ HEAD
  84. C1 master C0 C2 C3 C4 experiment C5 T1 git

    checkout experiment git commit HEAD
  85. C1 C0 C2 C3 C4 experiment C5 C6 master T1

    git checkout master git merge experiment HEAD
  86. CL1 origin/master C0 CL2 master CR3 CR1 CR4 origin/idea CR2

    git checkout -b tryidea origin/master CL2 master CR3 CR4 in/idea CR2 tryidea CL3
  87. CL1 origin/master C0 CL2 master CR3 CR1 CR4 origin/idea CR2

    tryidea CL3 git merge origin/master origin/idea
  88. public repo local repo local repo public repo git push

    (ssh) git fetch (git) internet A B C A B C A B C
  89. public repo local repo local repo public repo git push

    (ssh) git fetch (git) internet A B C A B C A B C D E F git commit
  90. public repo local repo local repo public repo git push

    (ssh) git fetch (git) git push (ssh) internet A B C A B C A B C D E F A B C D E F
  91. public repo local repo local repo public repo git fetch

    (http) git push (ssh) git fetch (git) git push (ssh) internet A B C A B C A B C D E F A B C D E F D E F
  92. public repo local repo local repo public repo git fetch

    (http) git push (ssh) git fetch (git) git push (ssh) internet A B C A B C A B C D E F A B C D E F D E F D E F
  93. schacon/ project developer nick developer jessica "public" my repo 5ec

    e4a 4a7 ce0 master git push public public/master 5ec e4a 4a7 ce0
  94. schacon/ project developer jessica "public" my repo 5ec e4a 4a7

    ce0 master git clone (url) public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick
  95. schacon/ project developer jessica "public" my repo 5ec e4a 4a7

    ce0 master git commit public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f
  96. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f git clone (url) 5ec e4a 4a7 ce0 developer jessica
  97. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git commit
  98. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git push 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09
  99. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git remote add nick git://github.com/nickh/project.git 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" git remote add nick git://github.com/nickh/project.git
  100. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git remote add nick git://github.com/nickh/project.git 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" “nick” git remote add nick git://github.com/nickh/project.git
  101. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git remote add jess git://github.com/jessica/project.git 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" git remote add jess git://github.com/jessica/project.git
  102. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git remote add jess git://github.com/jessica/project.git 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" git remote add jess git://github.com/jessica/project.git “jess”
  103. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git remote add jess git://github.com/jessica/project.git 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" schacon/ project "public" my repo 5ec e4a 4a7 ce0 master public/master 5ec e4a 4a7 ce0 git fetch nick 5ec c12 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "jess" c12 ec5 24f nick/master git fetch nick
  104. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git fetch nick 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" c12 ec5 24f nick/master
  105. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git remote add jess git://github.com/jessica/project.git 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" git fetch jess schacon/ project "public" my repo 5ec e4a 4a7 ce0 master public/m e4a git fetch jess e4a nickh/ project c12 ec5 24f jessic proje "nick" "jess ec5 24f nick/mas 2fb df7 4ea a09 jess/mas c12 schacon/ project "public" my repo 5ec e4a 4a7 ce0 master public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git fetch nick 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" c12 ec5 24f nick/master
  106. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git fetch jess 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" ec5 24f nick/master 2fb df7 4ea a09 jess/master c12
  107. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" ec5 24f nick/master 2fb df7 4ea a09 jess/master c12 b3b c63 git merge nick jess
  108. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 git push public 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" ec5 24f nick/master 2fb df7 4ea a09 jess/master c12 b3b c63 e4a ec5 24f 2fb df7 4ea a09 c12 b3b c63
  109. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" ec5 24f nick/master 2fb df7 4ea a09 jess/master c12 b3b c63 e4a ec5 24f 2fb df7 4ea a09 c12 b3b c63
  110. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" ec5 24f nick/master 2fb df7 4ea a09 jess/master c12 b3b c63 e4a ec5 24f 2fb df7 4ea a09 c12 b3b c63
  111. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" ec5 24f nick/master 2fb df7 4ea a09 jess/master c12 b3b c63 e4a ec5 24f 2fb df7 4ea a09 c12 b3b c63
  112. schacon/ project "public" my repo 5ec e4a 4a7 ce0 master

    public/master 5ec e4a 4a7 ce0 5ec e4a 4a7 ce0 developer nick c12 ec5 24f 5ec e4a 4a7 ce0 developer jessica 2fb df7 4ea a09 5ec e4a 4a7 ce0 nickh/ project c12 ec5 24f 5ec e4a 4a7 ce0 jessica/ project 2fb df7 4ea a09 "nick" "jess" ec5 24f nick/master 2fb df7 4ea a09 jess/master c12 b3b c63 e4a ec5 24f 2fb df7 4ea a09 c12 b3b c63
  113. C1 master C2 C3 C4 C1 C2 C5 C6 local

    jessica master git commit git commit
  114. C1 master C2 C3 C4 C1 C2 local jessica pack

    master git fetch jess C6 C5
  115. C1 jess/master C2 C3 C4 C5 C6 git merge C7

    master C1 jess/master C2 C3 C4 C5 C6 master git rebase
  116. C3' C4' C3 C4 C1 jess/master C2 C3 C4 C5

    C6 git merge C7 master C1 jess/master C2 C5 C6 master git rebase
  117. C3' C4' C3 C4 C1 jess/master C2 C3 C4 C5

    C6 git merge C7 master C1 jess/master C2 C5 C6 master git rebase
  118. C3' C4' C3 C4 C1 jess/master C2 C3 C4 C5

    C6 git merge C7 master C1 jess/master C2 C5 C6 master git rebase 1 2
  119. C3' C4' C3 C4 C1 jess/master C2 C3 C4 C5

    C6 git merge C7 master C1 jess/master C2 C5 C6 master git rebase 1 2
  120. C3' C4' C3 C4 C1 jess/master C2 C3 C4 C5

    C6 git merge C7 master C1 jess/master C2 C5 C6 master git rebase
  121. C3' C4' C1 jess/master C2 C3 C4 C5 C6 git

    merge C7 master C1 jess/master C2 C5 C6 master git rebase
  122. Treeish • full sha-1 • partial sha-1 • branch or

    tag name • date spec • ordinal spec • carrot parent • tilde spec • tree pointer • blob spec • ranges
  123. ce0e4 master 5ec47 2f45e 4eadf 2fbb3 18cae b3be1 a09c6 df2fa

    c36ae jess/master master^^^2 master~2^2
  124. ce0e4 master 5ec47 2f45e 4eadf 2fbb3 18cae b3be1 a09c6 df2fa

    c36ae jess/master master^^^2 master~2^2
  125. ce0e4 master 5ec47 2f45e 4eadf 2fbb3 18cae b3be1 a09c6 df2fa

    c36ae jess/master master^^^2 master~2^2
  126. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD git

    wdir mtime fname Object Directory Working Directory Index project/.git/index project/ project/.git/objects stage
  127. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD git

    wdir mtime fname Object Directory Working Directory Index project/.git/index project/ project/.git/objects stage git checkout
  128. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects e4a 24f e4a 24f file1 file2 1:30 1:30 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:30 git checkout 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD git wdir mtime fname Object Directory Working Directory Index project/.git/index project/ project/.git/objects stage
  129. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects e4a 24f e4a 24f file1 file2 1:30 1:30 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:30 git checkout 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD git wdir mtime fname Object Directory Working Directory Index project/.git/index project/ project/.git/objects stage
  130. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects e4a 24f e4a 24f file1 file2 1:30 1:30 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:30 git checkout 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD git wdir mtime fname Object Directory Working Directory Index project/.git/index project/ project/.git/objects stage
  131. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects e4a 24f e4a 24f file1 file2 1:30 1:30 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:30 git checkout 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD git wdir mtime fname Object Directory Working Directory Index project/.git/index project/ project/.git/objects stage
  132. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects e4a 24f e4a 24f file1 file2 1:30 1:30 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:30 git checkout 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD git wdir mtime fname Object Directory Working Directory Index project/.git/index project/ project/.git/objects stage
  133. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects e4a 24f e4a 24f file1 file2 1:30 1:30 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:30 git checkout
  134. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects e4a 24f e4a 24f file1 file2 1:30 1:30 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:31 vim file2
  135. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f e4a 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:31 git status
  136. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f e4a 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:31 git status
  137. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f e4a 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:31 git status
  138. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f e4a 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index e4a 24f stage /file1 /file2 1:30 1:31
  139. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f e4a 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:30 1:31 1ba git add file2
  140. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f e4a 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:30 1:31 1ba git add file2
  141. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f e4a 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:30 1:31 1ba git add file2
  142. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f e4a 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:30 1:31 1ba git add file2
  143. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f e4a 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:30 1:31 1ba git status
  144. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f e4a 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:30 1:31 1ba git status
  145. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f 1ba 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:30 1:31 1ba a3e 83d git commit
  146. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f 1ba 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:30 1:31 1ba a3e 83d git commit
  147. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f 1ba 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:30 1:31 1ba a3e 83d git commit
  148. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 1ba 24f 1ba 24f file1 file2 1:30 1:31 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:30 1:31 1ba a3e 83d git commit
  149. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 24f file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:32 1:32 1ba a3e 83d vim file1 file2 git status
  150. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 24f file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:32 1:32 1ba a3e 83d vim file1 file2 git status
  151. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 24f file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 24f stage /file1 /file2 1:32 1:32 1ba a3e 83d vim file1 file2 git status
  152. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 24f file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 91b stage /file1 /file2 1:32 1:32 1ba a3e 83d 91b git add file1
  153. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 24f file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 91b stage /file1 /file2 1:32 1:32 1ba a3e 83d 91b git add file1
  154. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 24f file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 91b stage /file1 /file2 1:32 1:32 1ba a3e 83d 91b git add file1
  155. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 24f file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 91b stage /file1 /file2 1:32 1:32 1ba a3e 83d 91b git status
  156. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 24f file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 91b stage /file1 /file2 1:32 1:32 1ba a3e 83d 91b git status
  157. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 24f file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 91b stage /file1 /file2 1:32 1:32 1ba a3e 83d 91b git status
  158. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 91b file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 91b stage /file1 /file2 1:32 1:32 1ba a3e 83d 91b 1a7 6c5 git commit
  159. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 91b file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 91b stage /file1 /file2 1:32 1:32 1ba a3e 83d 91b 1a7 6c5 git commit
  160. 5ec e4a 4a7 ce0 master ec5 24f c12 HEAD Object

    Directory Working Directory project/ project/.git/objects 6d4 91b 1ba 91b file1 file2 1:32 1:32 git wdir mtime fname Index project/.git/index 1ba 91b stage /file1 /file2 1:32 1:32 1ba a3e 83d 91b 1a7 6c5
  161. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 75% 35 min 12m How Do I Use Git?
  162. Multiple Commits $ git format-patch -o patches origin $ git

    send-email --to [email protected] patches $ git am mbox 1 patch file per commit in this directory
  163. Patching Rails git clone git://github.com/rails/rails.git cd rails; (vim/emacs etc) git

    format-patch origin/master --stdout > story.patch upload story.patch to rails.lighthouseapp.com
  164. branching workflow normal development want to try an idea have

    to do a hotfix merge idea into development push to production
  165. branching workflow normal development want to try an idea have

    to do a hotfix merge idea into development push to production
  166. branching workflow normal development want to try an idea have

    to do a hotfix merge idea into development push to production
  167. branching workflow normal development want to try an idea have

    to do a hotfix merge idea into development push to production
  168. branching workflow normal development want to try an idea have

    to do a hotfix merge idea into development push to production
  169. branching workflow normal development want to try an idea have

    to do a hotfix merge idea into development push to production
  170. develop C3 C0 story95 C4 C1 C2 C5 C6 C7

    master merge rebase develop C4 C0 story95 C5 C1 C2 C6' C3 master
  171. idea C3 master C0 develop story95 C4 C1 C2 C5

    C6 master git checkout master git commit
  172. develop C3 C0 story95 C4 C1 C2 C5 C6 master

    git checkout idea git merge develop git branch -d idea
  173. develop C3 C0 story95 C4 C1 C2 C5 C6 C7

    master git checkout master git merge develop
  174. • Local Commands • git config • git init •

    git add • git commit • git status • git tag • git log
  175. • Local Commands • git config • git init •

    git add • git commit • git status • git tag • git log • Branchy Commands • git checkout • git branch • git merge • git rebase
  176. • Local Commands • git config • git init •

    git add • git commit • git status • git tag • git log • Branchy Commands • git checkout • git branch • git merge • git rebase • Remotey Commands • git remote • git fetch • git pull • git clone • git push
  177. • Local Commands • git config • git init •

    git add • git commit • git status • git tag • git log • Branchy Commands • git checkout • git branch • git merge • git rebase • Remotey Commands • git remote • git fetch • git pull • git clone • git push • Patchy Commands • git diff • git apply • git format-patch • git am
  178. • Local Commands • git config • git init •

    git add • git commit • git status • git tag • git log • Branchy Commands • git checkout • git branch • git merge • git rebase • Remotey Commands • git remote • git fetch • git pull • git clone • git push • Patchy Commands • git diff • git apply • git format-patch • git am
  179. developer public developer public integration manager blessed repository developer private

    developer private github.com /schacon/ticgit /yob/ticgit /pope/ticgit
  180. developer public developer public integration manager blessed repository developer private

    developer private github.com /schacon/ticgit /yob/ticgit /pope/ticgit “forks”
  181. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 4m How Do I Deploy with Git? 15% 6 min
  182. 2m Who is Scott? What is Git? How Does Git

    Work? How Do I Use Git? 2m This Slide 3m 20m 12m How Do I Deploy with Git? 4m Where Can I Learn More? 2m 75% 35 min 15% 6 min 10% 4 min 2m Where Can I Learn More? 15% 6 min