Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.
Introduction to
	 	 Git & GitHub
by Matthew McCullough
Matthew McCullough
@matthewmccull
a brief history of
Git
“Cool kids” version control system
Open Source
bash scripts ☛ C code
≉
I'm an egotistical bastard, and
I name all my projects
after myself. First Linux,
now git.
-Linus Torvalds
“
”
GitHub
a RIA for Git
Social coding, within the Enterprise
Version control as a virtual appliance
Desktop tools as HTML5 components
In-browser syntax highlighted code editing
Conversations on proposed code changes
setting up a
Git Repo
No daemon
No special repo area
> cd myproj
> git init
Initialized empty Git repository
in /stuff/myproj/.git/
Deltas
vs. Copies
Typical SCMs use deltas
v1 v2 v3 v4
File A
File B
File C
File A
File B File B
File C
v5
File A
File BFile B
CVS, Subversion, darcs & Mercurial
Checkin
Checkin Checkin
Checkin
Checkin
Checkin
Checkin
Checkin
Checkin
Checkin
Checkin
Delta storage gets slower as the h...
Git uses Directed Acyclic Graphstorage
cp -r srcfolder srcfolder.prev
Copy of the entire tree per checkin
v1 v2 v3 v4
File A
File B
File C
File A
File B File B
File C
v5
File A
File BFile B
File A File A
File C File C File C
v1 v2 v3 v4
File A
File B
File C
File A
File B File B
File C
v5
File A
File BFile B
File A File A
File C File C File C
hardlinks to existing identical blobs
v1 v2 v3 v4
File A
File B
File C
File A
File B File B
File C
v5
File A
File BFile B
File A File A
File C File C File C
v1 v2 v3 v4
File A
File B
File C
File A
File B File B
File C
v5
File A
File BFile B
File A File A
File C File C File C
zlib deflates every blob at commit
v1 v2 v3 v4
File A
File B
File C
File A
File B File B
File C
v5
File A
File BFile B
File A File A
File C File C File C
v1 v2 v3 v4
File A
File B
File C
File A
File B File B
File C
v5
File A
File BFile B
File A File A
File C File C File C
zlib deflates entire repo
v1 v2 v3 v4
File A
File B
File C
File A
File B File B
File C
v5
File A
File BFile B
File A File A
File C File C File C
v1 v2 v3 v4
File A
File B
File C
File A
File B File B
File C
v5
File A
File BFile B
File A File A
File C File C File C
2100 MBbecame
205 MB
Act I
Add and
Commit
Working Staging Repo
checkout
add
commit
> git add <FILENAME>
> git status
# On branch master
# Initial commit
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)...
> git commit -m”<MESSAGE>”
[master (root-commit) 498cc44] My first commit
1 files changed, 5 insertions(+), 0 deletions(-)...
Local
Branches
Remote
Branches
Upstream
Branches
Working
Copy
commit
Branch and
Checkout
> git branch <BRANCHNAME>
Local
Branches
Remote
Branches
Upstream
Branches
Working
Copy
Local
Branches
Remote
Branches
Upstream
Branches
Working
Copy
> git checkout <BRANCHNAME>
Switched to branch 'mybranch'
Local
Branches
Remote
Branches
Upstream
Branches
Working
Copy
Local
Branches
Remote
Branches
Upstream
Branches
Working
Copy
Commit
Ref Syntax
9AB223D28B1AA46EF1780B22F304982E39872C34
<html>
<body>
<p>This is a test</p>
<img src="http://ai.com/
icon.gif">
</body>
<...
9AB223D28B1AA46EF1780B22F304982E39872C34
<html>
<body>
<p>This is a test</p>
<img src="http://ai.com/
icon.gif">
</body>
<...
tree
tree: 7e8b1 web
blob: 9ab16 index.html
a10b3
tree
blob: 8d162 logo.jpg
blob: 51d22 draw.js
7e8b1commit
tree: a10b3
pa...
tree
tree: 7e8b1 web
blob: 9ab16 index.html
a10b3
tree
blob: 8d162 logo.jpg
blob: 51d22 draw.js
7e8b1commit
tree: a10b3
pa...
tree
tree: 7e8b1 web
blob: 9ab16 index.html
a10b3
tree
blob: 8d162 logo.jpg
blob: 51d22 draw.js
7e8b1commit
tree: a10b3
pa...
tree
tree: 7e8b1 web
blob: 9ab16 index.html
a10b3
tree
blob: 8d162 logo.jpg
blob: 51d22 draw.js
7e8b1commit
tree: a10b3
pa...
tree
tree: 7e8b1 web
blob: 9ab16 index.html
a10b3
tree
blob: 8d162 logo.jpg
blob: 51d22 draw.js
7e8b1commit
tree: a10b3
pa...
tree
tree: 7e8b1 web
blob: 9ab16 index.html
a10b3
tree
blob: 8d162 logo.jpg
blob: 51d22 draw.js
7e8b1commit
tree: a10b3
pa...
tree
tree: 7e8b1 web
blob: 9ab16 index.html
a10b3
tree
blob: 8d162 logo.jpg
blob: 51d22 draw.js
7e8b1commit
tree: a10b3
pa...
tree
tree: 7e8b1 web
blob: 9ab16 index.html
a10b3
tree
blob: 8d162 logo.jpg
blob: 51d22 draw.js
7e8b1commit
tree: a10b3
pa...
tree
tree: 7e8b1 web
blob: 9ab16 index.html
a10b3
tree
blob: 8d162 logo.jpg
blob: 51d22 draw.js
7e8b1commit
tree: a10b3
pa...
v1 v2 v3
commit
tree: 9a87b
parent: nil
author: Fird
committer: Matthew
message:
Major refactoring
of the Javascript rende...
v1 v2 v3
commit
tree: 9a87b
parent: nil
author: Fird
committer: Matthew
message:
Major refactoring
of the Javascript rende...
v1 v2 v3
commit
tree: 9a87b
parent: nil
author: Fird
committer: Matthew
message:
Major refactoring
of the Javascript rende...
v1 v2 v3
commit
tree: 9a87b
parent: nil
author: Fird
committer: Matthew
message:
Major refactoring
of the Javascript rende...
v1 v2 v3
commit
tree: 9a87b
parent: nil
author: Fird
committer: Matthew
message:
Major refactoring
of the Javascript rende...
v1 v2 v3
commit
tree: 9a87b
parent: nil
author: Fird
committer: Matthew
message:
Major refactoring
of the Javascript rende...
v1 v2 v3
commit
tree: 9a87b
parent: nil
author: Fird
committer: Matthew
message:
Major refactoring
of the Javascript rende...
v1 v2 v3
commit
tree: 9a87b
parent: nil
author: Fird
committer: Matthew
message:
Major refactoring
of the Javascript rende...
Distributed
Connectivity
developer A
developer A developer B
developer A developer B
developer A developer B
blessed repo
developer A developer B
Workflows
and collaboration
Central
Repo
Centralized
Central
Repo
Centralized
Blessed
Repo
Dictatorship
Blessed
Repo
Dictatorship
Blessed
Repo
Dictatorship
Blessed
Repo
Dictatorship
Blessed
Repo
Dictatorship
Certified
Repo
Development
Repo
IntegrationManaged
Certified
Repo
Development
Repo
IntegrationManaged
Certified
Repo
Development
Repo
IntegrationManaged
Certified
Repo
Development
Repo
IntegrationManaged
Mirror
Development
Repo
Mirrored
Mirror
Certified
Repo
Mirror
Development
Repo
Mirrored
Mirror
Certified
Repo
Custom+PublicContrib
☚PrivatePublic☛
GitHub
Custom+PublicContrib
☚PrivatePublic☛
GitHub
Custom+PublicContrib
Customized
☚PrivatePublic☛
GitHub
Custom+PublicContrib
Customized
☚PrivatePublic☛
GitHub
Git’s
notable users
Introduction to
	 	 Git & GitHub
by Matthew McCullough
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Intro to Git and GitHub
Próxima SlideShare
Cargando en…5
×

Intro to Git and GitHub

472 visualizaciones

Publicado el

Are you curious what Git and GitHub are? Let Matthew McCullough of GitHub show you in just a few short minutes and a series of instructive graphics.

Publicado en: Tecnología
  • Sé el primero en comentar

Intro to Git and GitHub

  1. 1. Introduction to Git & GitHub by Matthew McCullough
  2. 2. Matthew McCullough @matthewmccull
  3. 3. a brief history of Git
  4. 4. “Cool kids” version control system
  5. 5. Open Source
  6. 6. bash scripts ☛ C code
  7. 7.
  8. 8. I'm an egotistical bastard, and I name all my projects after myself. First Linux, now git. -Linus Torvalds “ ”
  9. 9. GitHub a RIA for Git
  10. 10. Social coding, within the Enterprise
  11. 11. Version control as a virtual appliance
  12. 12. Desktop tools as HTML5 components
  13. 13. In-browser syntax highlighted code editing
  14. 14. Conversations on proposed code changes
  15. 15. setting up a Git Repo
  16. 16. No daemon
  17. 17. No special repo area
  18. 18. > cd myproj > git init Initialized empty Git repository in /stuff/myproj/.git/
  19. 19. Deltas vs. Copies
  20. 20. Typical SCMs use deltas
  21. 21. v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B
  22. 22. CVS, Subversion, darcs & Mercurial
  23. 23. Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Delta storage gets slower as the history of a file gets longer
  24. 24. Git uses Directed Acyclic Graphstorage
  25. 25. cp -r srcfolder srcfolder.prev
  26. 26. Copy of the entire tree per checkin
  27. 27. v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  28. 28. v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  29. 29. hardlinks to existing identical blobs
  30. 30. v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  31. 31. v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  32. 32. zlib deflates every blob at commit
  33. 33. v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  34. 34. v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  35. 35. zlib deflates entire repo
  36. 36. v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  37. 37. v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  38. 38. 2100 MBbecame 205 MB Act I
  39. 39. Add and Commit
  40. 40. Working Staging Repo checkout add commit
  41. 41. > git add <FILENAME>
  42. 42. > git status # On branch master # Initial commit # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # new file: myfile.txt
  43. 43. > git commit -m”<MESSAGE>” [master (root-commit) 498cc44] My first commit 1 files changed, 5 insertions(+), 0 deletions(-) create mode 100644 myfile.txt
  44. 44. Local Branches Remote Branches Upstream Branches Working Copy commit
  45. 45. Branch and Checkout
  46. 46. > git branch <BRANCHNAME>
  47. 47. Local Branches Remote Branches Upstream Branches Working Copy
  48. 48. Local Branches Remote Branches Upstream Branches Working Copy
  49. 49. > git checkout <BRANCHNAME> Switched to branch 'mybranch'
  50. 50. Local Branches Remote Branches Upstream Branches Working Copy
  51. 51. Local Branches Remote Branches Upstream Branches Working Copy
  52. 52. Commit Ref Syntax
  53. 53. 9AB223D28B1AA46EF1780B22F304982E39872C34 <html> <body> <p>This is a test</p> <img src="http://ai.com/ icon.gif"> </body> </html>
  54. 54. 9AB223D28B1AA46EF1780B22F304982E39872C34 <html> <body> <p>This is a test</p> <img src="http://ai.com/ icon.gif"> </body> </html>
  55. 55. tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob<html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  56. 56. tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob<html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  57. 57. tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob<html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  58. 58. tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob<html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  59. 59. tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob<html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  60. 60. tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob<html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  61. 61. tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob<html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  62. 62. tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob<html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  63. 63. tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob<html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  64. 64. v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7
  65. 65. v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7
  66. 66. v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7
  67. 67. v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7
  68. 68. v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7
  69. 69. v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7
  70. 70. v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7
  71. 71. v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7
  72. 72. Distributed Connectivity
  73. 73. developer A
  74. 74. developer A developer B
  75. 75. developer A developer B
  76. 76. developer A developer B
  77. 77. blessed repo developer A developer B
  78. 78. Workflows and collaboration
  79. 79. Central Repo Centralized
  80. 80. Central Repo Centralized
  81. 81. Blessed Repo Dictatorship
  82. 82. Blessed Repo Dictatorship
  83. 83. Blessed Repo Dictatorship
  84. 84. Blessed Repo Dictatorship
  85. 85. Blessed Repo Dictatorship
  86. 86. Certified Repo Development Repo IntegrationManaged
  87. 87. Certified Repo Development Repo IntegrationManaged
  88. 88. Certified Repo Development Repo IntegrationManaged
  89. 89. Certified Repo Development Repo IntegrationManaged
  90. 90. Mirror Development Repo Mirrored Mirror Certified Repo
  91. 91. Mirror Development Repo Mirrored Mirror Certified Repo
  92. 92. Custom+PublicContrib ☚PrivatePublic☛ GitHub
  93. 93. Custom+PublicContrib ☚PrivatePublic☛ GitHub
  94. 94. Custom+PublicContrib Customized ☚PrivatePublic☛ GitHub
  95. 95. Custom+PublicContrib Customized ☚PrivatePublic☛ GitHub
  96. 96. Git’s notable users
  97. 97. Introduction to Git & GitHub by Matthew McCullough

×