Git

1,051 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,051
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • The audience: How many developers?\n\nQuestions: please interrupt with directly on-topic questions. Please save the anticipatory or unrelated questions to the end.\n
  • git is a version control tool\n\nLinus Torvalds wrote it. Says he has a propensity for naming his projects after himself.\n\nDistributed: no latency commits, productivity when offline or server down, all repositories equal, create your own workflow.\n\nPowerful: lightweight branching, robust merging, rebase.\n\nFast: hard links when available, efficient lookups via FS\n\nBut it has abstractions bleeding from its pores. You really have to understand how it works to use it effectively. Hence, this presentation.\n
  • Lean on your version control!\n- Avoid dead code, unnecessary/misleading comments, backup files\n- Make changes fearlessly\nUse your version control so that it can be leaned on\n- Meaningful commits and commit messages\n- Keep commits small and distinct\n- Avoid unnecessary formatting changes\nReasoning about the code base\n- Your version control needs to have a coherent history\n
  • \n
  • \n
  • \n
  • \n
  • Make changes to the working copy\n
  • Make changes to the index\n
  • Make changes to the index\n
  • Make changes to the index\n
  • Make changes to the index\n
  • Make changes to the index\n
  • Make changes to the index\n
  • Make changes to the index\n
  • Make changes to the index\n
  • Make changes to the index\n
  • Make changes to the index\n
  • Make changes to the index\n
  • Make changes to the object store\n\nThese are the three areas you work with: the working copy, the staging area or index, the object store.\n
  • Make changes to the object store\n\nThese are the three areas you work with: the working copy, the staging area or index, the object store.\n
  • Make changes to the object store\n\nThese are the three areas you work with: the working copy, the staging area or index, the object store.\n
  • Make changes to the object store\n\nThese are the three areas you work with: the working copy, the staging area or index, the object store.\n
  • Making changes, staging them, and committing is the majority of what you do in git.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Make changes to the working copy\n
  • \n
  • Key/Value database\nKey is the SHA1 hash of the Value\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Three main types of objects in the object store. The two depicted here are blobs and trees.\nA blob represents files in the filesystem.\nA tree represents directories in the filesystem.\n
  • Three main types of objects in the object store. The two depicted here are blobs and trees.\nA blob represents files in the filesystem.\nA tree represents directories in the filesystem.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Where are we now? We have learned:\n- the three main types of objects in the object store\n- commits are snapshots of the working copy\n- commit history is a directed acyclic graph of commits\n- commits are documents that point to trees and other commits\n- trees are documents that point to blobs and other trees\n- blobs are the end of the line\n\nWhat are we missing?\n(cat picture)\n
  • \n
  • I referred to HEAD earlier. What’s that?\nIt’s called a ref. Refs point to commits, sometimes directly, sometimes indirectly. HEAD is a ref to the branch you’re currently on.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • git add --patch is a great way to stage only the changes you want.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • A branch is just a different HEAD reference. It may or may not point to the same commit as another branch.\nMerging means creating a commit with 2 parent commits.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Say you have a commit in your master branch\n
  • Create what’s called a topic branch.\nbug-142 is now your current branch.\n
  • Fix your code and check in your changes.\n
  • Go back to master while you wait for the bug-142 branch to be verified, merged, whatever.\n
  • Make a small change and commit.\n
  • Merge bug-142 into master\n\nNotice bug-142 still points to its old commit. Merging typically doesn’t affect anything but the HEAD.\n
  • Where merging is joining two or more nodes into one node by creating a new node,\nrebasing is cutting a portion of the graph off and reparenting it.\nHow does this work? <replay patches>\n
  • Let’s say we have the two branches from before, but this time, I want my bug-142 branch to be rebased off of master. This could be to incorporate changes master has, or whatever.\n
  • Check out bug-142 again\n
  • Do the rebase!\n\nIt backs C2 out and pushes it onto a stack of patches\nThen it moves to C3.\nThen it replays the patch.\n\nThis creates new commits. Why? New trees, new commit timestamps, etc, all lead to new SHA1 hashes.\n\nNotice the dangling C2.\n\nThis is an important principle. VERY RARELY does stuff get expunged from your object store. It’s typically add-only.\n
  • \n
  • \n
  • \n
  • Just to get the polarizing irrelevant stuff:\nVim, not emacs. Spaces, not tabs. Ruby, not Python. Black licorice (red licorice isn’t fit to bear the name).\nI won’t tell you my distro of choice because of where we are. ;)\n
  • Git

    1. 1. Fundamentals of GitUsage and InternalsJimmy Thrasher <jimmy@brownbirdlabs.com> @jimmythrasher
    2. 2. git(n) - a contemptible person, often a fool
    3. 3. Philosophy
    4. 4. Basic Usage, Pass I
    5. 5. Initialize the repo
    6. 6. Initialize the repo$ mkdir arithmetic; cd arithmetic
    7. 7. Initialize the repo$ mkdir arithmetic; cd arithmetic$ git init
    8. 8. Initialize the repo$ mkdir arithmetic; cd arithmetic$ git initInitialized empty Git repository in <path>/arithmetic/.git/
    9. 9. Generate some code $ cat > arithmetic.rb def plus(a, b); a + b; end ^D
    10. 10. Stage the changes
    11. 11. Stage the changes$ git add .
    12. 12. Stage the changes$ git add .$ git status
    13. 13. Stage the changes$ git add .$ git status# On branch master## Initial commit## Changes to be committed:# (use "git rm --cached <file>..." to unstage)## new file: arithmetic.rb#
    14. 14. Commit!
    15. 15. Commit!$ git commit -m "First post"
    16. 16. Commit!$ git commit -m "First post"[master (root-commit) 0ca3306] First post 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 arithmetic.rb
    17. 17. 20 GOTO 10
    18. 18. Basic Usage, Pass II
    19. 19. $ mkdir arithmetic; cd arithmetic$ git initInitialized empty Git repository in <path>/arithmetic/.git/
    20. 20. $ ls -l .git
    21. 21. $ ls -l .gittotal 24-rw-r--r-- 1 jjthrash staff 23 Nov 6 21:05 HEAD-rw-r--r-- 1 jjthrash staff 111 Nov 6 21:05 config-rw-r--r-- 1 jjthrash staff 73 Nov 6 21:05 descriptiondrwxr-xr-x 12 jjthrash staff 408 Nov 6 21:05 hooksdrwxr-xr-x 3 jjthrash staff 102 Nov 6 21:05 infodrwxr-xr-x 4 jjthrash staff 136 Nov 6 21:05 objectsdrwxr-xr-x 4 jjthrash staff 136 Nov 6 21:05 refs
    22. 22. Generate some code $ cat > arithmetic.rb def plus(a, b); a + b; end ^D
    23. 23. $ git add .$ git status# On branch master## Initial commit## Changes to be committed:# (use "git rm --cached <file>..." to unstage)## new file: arithmetic.rb#
    24. 24. The Object Store
    25. 25. $ cat arithmetic.rb | git hash-object --stdin
    26. 26. $ cat arithmetic.rb | git hash-object --stdin171fe423f0146d107db5d5c94ba205d86549ff14
    27. 27. $ cat arithmetic.rb | git hash-object --stdin171fe423f0146d107db5d5c94ba205d86549ff14$ git cat-file -p 171fe423f0146d107db5d5c94ba205d86549ff14
    28. 28. $ cat arithmetic.rb | git hash-object --stdin171fe423f0146d107db5d5c94ba205d86549ff14$ git cat-file -p 171fe423f0146d107db5d5c94ba205d86549ff14def plus(a, b); a + b; end
    29. 29. $ cat arithmetic.rb | git hash-object --stdin171fe423f0146d107db5d5c94ba205d86549ff14$ git cat-file -p 171fe423f0146d107db5d5c94ba205d86549ff14def plus(a, b); a + b; end$ find .git/objects -type f
    30. 30. $ cat arithmetic.rb | git hash-object --stdin171fe423f0146d107db5d5c94ba205d86549ff14$ git cat-file -p 171fe423f0146d107db5d5c94ba205d86549ff14def plus(a, b); a + b; end$ find .git/objects -type f.git/objects/17/1fe423f0146d107db5d5c94ba205d86549ff14
    31. 31. $ cat .git/index
    32. 32. $ cat .git/indexarithmetic.rb?k>???#?m}?ϸk?S??`m?I??
    33. 33. $ git commit -m "First post"[master (root-commit) 0ca3306] First post 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 arithmetic.rb
    34. 34. More Object Store
    35. 35. More Object Store ©Scott Chacon, Fig 9-1 “Git Internals—Git Objects”
    36. 36. More Object Store
    37. 37. More Object Store ©Scott Chacon, Fig 9-3 “Git Internals—Git Objects”
    38. 38. $ git rev-parse HEAD
    39. 39. $ git rev-parse HEAD0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3
    40. 40. $ git rev-parse HEAD0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3$ git cat-file -p 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3
    41. 41. $ git rev-parse HEAD0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3$ git cat-file -p 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3tree a9974d0f707a302dfd82370c357e87e1df813658author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463-0500First post
    42. 42. $ git rev-parse HEAD0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3$ git cat-file -p 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3tree a9974d0f707a302dfd82370c357e87e1df813658author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463-0500First post$ git cat-file -p a9974d0f707a302dfd82370c357e87e1df813658
    43. 43. $ git rev-parse HEAD0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3$ git cat-file -p 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3tree a9974d0f707a302dfd82370c357e87e1df813658author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463-0500First post$ git cat-file -p a9974d0f707a302dfd82370c357e87e1df813658100644 blob 171fe423f0146d107db5d5c94ba205d86549ff14arithmetic.rb
    44. 44. $ git rev-parse HEAD0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3$ git cat-file -p 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3tree a9974d0f707a302dfd82370c357e87e1df813658author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463-0500First post$ git cat-file -p a9974d0f707a302dfd82370c357e87e1df813658100644 blob 171fe423f0146d107db5d5c94ba205d86549ff14arithmetic.rb$ cat arithmetic.rb | git hash-object --stdin
    45. 45. $ git rev-parse HEAD0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3$ git cat-file -p 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3tree a9974d0f707a302dfd82370c357e87e1df813658author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463-0500First post$ git cat-file -p a9974d0f707a302dfd82370c357e87e1df813658100644 blob 171fe423f0146d107db5d5c94ba205d86549ff14arithmetic.rb$ cat arithmetic.rb | git hash-object --stdin171fe423f0146d107db5d5c94ba205d86549ff14
    46. 46. $ find .git/objects -type f
    47. 47. $ find .git/objects -type f.git/objects/0c/a330690c2d1471ca4aa4c18c8fe3f53883f7a3.git/objects/17/1fe423f0146d107db5d5c94ba205d86549ff14.git/objects/a9/974d0f707a302dfd82370c357e87e1df813658
    48. 48. Recap
    49. 49. Refs
    50. 50. $ find .git/refs -type f
    51. 51. $ find .git/refs -type f.git/refs/heads/master
    52. 52. $ find .git/refs -type f.git/refs/heads/master$ cat .git/refs/heads/master
    53. 53. $ find .git/refs -type f.git/refs/heads/master$ cat .git/refs/heads/master0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3
    54. 54. $ find .git/refs -type f.git/refs/heads/master$ cat .git/refs/heads/master0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3$ git log
    55. 55. $ find .git/refs -type f.git/refs/heads/master$ cat .git/refs/heads/master0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3$ git logcommit 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3 (HEAD, master)Author: Jimmy Thrasher <jimmy@jimmythrasher.com>Date: Tue Nov 6 21:14:23 2012 -0500 First post
    56. 56. $ find .git/refs -type f.git/refs/heads/master$ cat .git/refs/heads/master0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3$ git logcommit 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3 (HEAD, master)Author: Jimmy Thrasher <jimmy@jimmythrasher.com>Date: Tue Nov 6 21:14:23 2012 -0500 First post$ cat .git/HEAD
    57. 57. $ find .git/refs -type f.git/refs/heads/master$ cat .git/refs/heads/master0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3$ git logcommit 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3 (HEAD, master)Author: Jimmy Thrasher <jimmy@jimmythrasher.com>Date: Tue Nov 6 21:14:23 2012 -0500 First post$ cat .git/HEADref: refs/heads/master
    58. 58. Making History
    59. 59. Add another commit
    60. 60. Add another commit$ cat >> arithmetic.rb
    61. 61. Add another commit$ cat >> arithmetic.rbdef minus(a, b); a - b; end
    62. 62. Add another commit$ cat >> arithmetic.rbdef minus(a, b); a - b; end$ git add --patch
    63. 63. Add another commit$ cat >> arithmetic.rbdef minus(a, b); a - b; end$ git add --patchdiff --git a/arithmetic.rb b/arithmetic.rbindex 171fe42..5c66815 100644--- a/arithmetic.rb+++ b/arithmetic.rb@@ -1 +1,2 @@ def plus(a, b); a + b; end+def minus(a, b); a - b; endStage this hunk [y,n,q,a,d,/,e,?]? y
    64. 64. Add another commit$ cat >> arithmetic.rbdef minus(a, b); a - b; end$ git add --patchdiff --git a/arithmetic.rb b/arithmetic.rbindex 171fe42..5c66815 100644--- a/arithmetic.rb+++ b/arithmetic.rb@@ -1 +1,2 @@ def plus(a, b); a + b; end+def minus(a, b); a - b; endStage this hunk [y,n,q,a,d,/,e,?]? y$ git commit -m "Double the featureset"
    65. 65. Add another commit$ cat >> arithmetic.rbdef minus(a, b); a - b; end$ git add --patchdiff --git a/arithmetic.rb b/arithmetic.rbindex 171fe42..5c66815 100644--- a/arithmetic.rb+++ b/arithmetic.rb@@ -1 +1,2 @@ def plus(a, b); a + b; end+def minus(a, b); a - b; endStage this hunk [y,n,q,a,d,/,e,?]? y$ git commit -m "Double the featureset"[master d4655dd] Double the featureset 1 files changed, 1 insertions(+), 0 deletions(-)
    66. 66. $ # the commit$ git cat-file -p d4655ddec0830408c8a9eb2e97ff882254aa72ce
    67. 67. $ # the commit$ git cat-file -p d4655ddec0830408c8a9eb2e97ff882254aa72cetree adaa5519b385d57417efc1667a9ab9d86473e578parent 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222-0500Double the featureset
    68. 68. $ # the commit$ git cat-file -p d4655ddec0830408c8a9eb2e97ff882254aa72cetree adaa5519b385d57417efc1667a9ab9d86473e578parent 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222-0500Double the featureset$ # the tree$ git cat-file -p adaa5519b385d57417efc1667a9ab9d86473e578
    69. 69. $ # the commit$ git cat-file -p d4655ddec0830408c8a9eb2e97ff882254aa72cetree adaa5519b385d57417efc1667a9ab9d86473e578parent 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222-0500Double the featureset$ # the tree$ git cat-file -p adaa5519b385d57417efc1667a9ab9d86473e578100644 blob 5c66815e4bccb85068bc884ea7963fd45347c212 arithmetic.rb
    70. 70. $ # the commit$ git cat-file -p d4655ddec0830408c8a9eb2e97ff882254aa72cetree adaa5519b385d57417efc1667a9ab9d86473e578parent 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222-0500Double the featureset$ # the tree$ git cat-file -p adaa5519b385d57417efc1667a9ab9d86473e578100644 blob 5c66815e4bccb85068bc884ea7963fd45347c212 arithmetic.rb$ # the old commit$ git cat-file -p 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3
    71. 71. $ # the commit$ git cat-file -p d4655ddec0830408c8a9eb2e97ff882254aa72cetree adaa5519b385d57417efc1667a9ab9d86473e578parent 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222-0500Double the featureset$ # the tree$ git cat-file -p adaa5519b385d57417efc1667a9ab9d86473e578100644 blob 5c66815e4bccb85068bc884ea7963fd45347c212 arithmetic.rb$ # the old commit$ git cat-file -p 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3tree a9974d0f707a302dfd82370c357e87e1df813658author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463-0500First post
    72. 72. $ # the commit$ git cat-file -p d4655ddec0830408c8a9eb2e97ff882254aa72cetree adaa5519b385d57417efc1667a9ab9d86473e578parent 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222-0500Double the featureset$ # the tree$ git cat-file -p adaa5519b385d57417efc1667a9ab9d86473e578100644 blob 5c66815e4bccb85068bc884ea7963fd45347c212 arithmetic.rb$ # the old commit$ git cat-file -p 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3tree a9974d0f707a302dfd82370c357e87e1df813658author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463-0500First post$ # the old tree$ git cat-file -p a9974d0f707a302dfd82370c357e87e1df813658
    73. 73. $ # the commit$ git cat-file -p d4655ddec0830408c8a9eb2e97ff882254aa72cetree adaa5519b385d57417efc1667a9ab9d86473e578parent 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352329222-0500Double the featureset$ # the tree$ git cat-file -p adaa5519b385d57417efc1667a9ab9d86473e578100644 blob 5c66815e4bccb85068bc884ea7963fd45347c212 arithmetic.rb$ # the old commit$ git cat-file -p 0ca330690c2d1471ca4aa4c18c8fe3f53883f7a3tree a9974d0f707a302dfd82370c357e87e1df813658author Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463 -0500committer Jimmy Thrasher <jimmy@jimmythrasher.com> 1352254463-0500First post$ # the old tree$ git cat-file -p a9974d0f707a302dfd82370c357e87e1df813658100644 blob 171fe423f0146d107db5d5c94ba205d86549ff14arithmetic.rb
    74. 74. Object Store©Scott Chacon, Fig 9-3 “Git Internals—Git Objects”
    75. 75. Branching and Merging
    76. 76. $ git cat-file -p HEAD
    77. 77. $ git cat-file -p HEADtree 6436ce8f07792aec3ec132fc4abb59d2a827cba7parent 772883c59078484dc8990ffbc509e249e22a6c84parent ff3ab8a25f623d4ceb3ea189090879dc67693cb5author Rafael Mendonça França <rafaelmfranca@gmail.com> 1352404208-0800committer Rafael Mendonça França <rafaelmfranca@gmail.com>1352404208 -0800Merge pull request #8115 from senny/7842_handle_trailing_slash_with_engineshandle trailing slash with engines (test case for #7842)
    78. 78. master (HEAD) C1
    79. 79. git checkout -b bug-142 master master C1bug-142 (HEAD)
    80. 80. #change code git commit -am “Fix problem with the widgets” C2 bug-142 (HEAD)master C1
    81. 81. git checkout master C2 bug-142master (HEAD) C1
    82. 82. # make more changes git commit -am “Moar changes!!1!”master (HEAD) C3 C2 bug-142 C1
    83. 83. git merge bug-142master (HEAD) C4 C3 C2 bug-142 C1
    84. 84. Rebasing
    85. 85. # got 2 branchesmaster (HEAD) C3 C2 bug-142 C1
    86. 86. git checkout bug-142master C3 C2 bug-142 (HEAD) C1
    87. 87. git rebase master C4 bug-142 (HEAD)master C3 C2 C1
    88. 88. What didn’t I cover?• Workflow recommendations• Remotes, tags, “tree-ish”• Working with other developers• GitHub Pull Requests• Handy tips and tricks• etc
    89. 89. I Recommend• Pro-Git, by Scott Chacon (free ebook)• Everything git-related by @tpope
    90. 90. Thank You!
    91. 91. Q&A

    ×