Git going
                       DVCS
             with
                                n bending
                    ment...
“   Git
        -noun                    sant or
                          unplea
                Slang. an
        Britis...
astard, and
          otistical b
“
I'm an eg
                  projects
           all my
    I name
           yself. Fi...
RCS

Folders
Clear
           Source   Case
            Safe
                    CVS
           PVCS
     RCS

Folders
Subversion
                            BitKeeper

                                  Perforce
                    Clear
   ...
darcs
                                                     Mercurial


                                                   ...
t
Source Code Control
Gi
Gi
Source Code Control

      t
CultureChange

8
=Don’t
Centralized
      VCS
Innovate




16
Experiment




16
Safely Be Wrong



16
Drive-by Assist

16
Crowd Source
16
18
19
Global Git Settings

     git config --global user.name quot;Hal Smithquot;




20
Global Git Settings

     git config --global user.name quot;Hal Smithquot;

     git config --global user.email quot;hal@bn...
Global Git Settings

     git config --global user.name quot;Hal Smithquot;

     git config --global user.email quot;hal@bn...
Creating a Repo

     mkdir myproj.git




21
Creating a Repo

     mkdir myproj.git
     cd myproj.git




21
Creating a Repo

     mkdir myproj.git
     cd myproj.git
                               lks!
                           t...
22
22
Who’s Got   Git?

23
Hashes and
           Integrity


28
SHA-1 Hash
     Index vs. Hash
     ‣ Centralized VCS uses DB auto-increment index.
     ‣ Git uses SHA-1 hash.
     ‣ Has...
SHA-1 Hash
     Index vs. Hash
     ‣ Centralized VCS uses DB auto-increment index.
     ‣ Git uses SHA-1 hash.
     ‣ Has...
http://book.git-scm.com/1_the_git_object_model.html




30
http://book.git-scm.com/1_the_git_object_model.html




30
http://book.git-scm.com/1_the_git_object_model.html




30
http://book.git-scm.com/1_the_git_object_model.html




30
alized
      entr
    C
Alice           Bob
alized
           entr
         C
  Alice              Bob
1 = okay.htm
alized
           entr
         C
  Alice              Bob
1 = okay.htm

2 = fine.htm
alized
           entr
         C
  Alice               Bob
1 = okay.htm

2 = fine.htm    Sync
alized
           entr
         C
  Alice                 Bob
1 = okay.htm          1 = okay.htm

2 = fine.htm           2 ...
alized
           entr
         C
  Alice                  Bob
1 = okay.htm          1 = okay.htm

2 = fine.htm           2...
alized
           entr
         C
  Alice                   Bob
1 = okay.htm           1 = okay.htm

2 = fine.htm          ...
alized
           entr
         C
  Alice                   Bob
1 = okay.htm           1 = okay.htm

2 = fine.htm          ...
alized
           entr
         C
  Alice                   Bob
1 = okay.htm           1 = okay.htm

2 = fine.htm          ...
alized
            entr
          C
   Alice                    Bob
 1 = okay.htm            1 = okay.htm

 2 = fine.htm   ...
Distributed
Alice         Bob
Distributed
    Alice             Bob
a233b76 = okay.htm
Distributed
    Alice             Bob
a233b76 = okay.htm

d234ab1 = fine.htm
Distributed
    Alice                   Bob
a233b76 = okay.htm

d234ab1 = fine.htm    Sync
Distributed
    Alice                        Bob
a233b76 = okay.htm          a233b76 = okay.htm

d234ab1 = fine.htm        ...
Distributed
    Alice                        Bob
a233b76 = okay.htm          a233b76 = okay.htm

d234ab1 = fine.htm        ...
Distributed
     Alice                        Bob
a233b76 = okay.htm           a233b76 = okay.htm

d234ab1 = fine.htm      ...
Distributed
     Alice                        Bob
a233b76 = okay.htm           a233b76 = okay.htm

d234ab1 = fine.htm      ...
Distributed
     Alice                        Bob
a233b76 = okay.htm           a233b76 = okay.htm

d234ab1 = fine.htm      ...
Hash Benefits
     Integrity
     ‣ Identifies damaged repos.
     ‣ Prevents modification of published history.
     ‣ Uniq...
Location,Location,Location




36
Remote
        is like a special
Stash
                            Repo




                     Index
   Working
Remote
        is like a special
Stash
                            Repo




                     Index
   Working
Remote
        is like a special
Stash
                            Repo
                                   git clone




 ...
Remote
        is like a special
Stash
                            Repo
                                   git clone
     ...
Remote
        is like a special
Stash
                            Repo
                                   git clone
     ...
Remote
        is like a special
Stash
                            Repo
                                   git clone
     ...
Remote
        is like a special
Stash
                            Repo
                                   git clone
     ...
Remote
        is like a special
Stash
                            Repo
                                   git clone
     ...
Remote
        is like a special
Stash
                            Repo
                                   git clone
     ...
Remote
        is like a special
Stash
                            Repo
                                   git clone
     ...
Remote
        is like a special
Stash
                            Repo
                                   git clone
     ...
Remote
        is like a special
Stash
                            Repo
                                   git clone
     ...
repo
                                               uild
                                             B
     git clone git...
repo
                                               uild
                                             B
     git clone git...
repo
                                               uild
                                             B
     git clone git...
repo
                                                  uild
                                                B
     git clo...
repo
                                                   uild
                                                 B
     git c...
Single Stage Thinking

     Subversion
         svn commit
     ‣
     ‣   Adds everything modified.
     ‣   Must list if ...
$ echo //password >> Matt1.java
     $ echo //password >> Matt2.java




40
$ echo //password >> Matt1.java
     $ echo //password >> Matt2.java

     $ svn status
     M      Matt1.java
     M     ...
$ echo //password >> Matt1.java
     $ echo //password >> Matt2.java

     $ svn status
     M      Matt1.java
     M     ...
Three Stage Thinking
     Git
         git add
     ‣
         git commit
     ‣
         git push
     ‣
     ‣   Commits...
$ echo //SECRETPASSWORD >> mattfile1.java
     $ echo //NewText2 >> mattfile2.java




42
$ echo //SECRETPASSWORD >> mattfile1.java
     $ echo //NewText2 >> mattfile2.java

     $ git status
     # On branch mas...
$ echo //SECRETPASSWORD >> mattfile1.java
     $ echo //NewText2 >> mattfile2.java

     $ git status
     # On branch mas...
$ echo //SECRETPASSWORD >> mattfile1.java
     $ echo //NewText2 >> mattfile2.java

     $ git status
     # On branch mas...
#$%^&!
     I just committed my password!




43
Change History
     $ git reset --hard HEAD^
     HEAD is now at 9de4cd3 First checkin

     $ git log
     commit 9de4cd3...
Change History
                                                      mit
                                                 ...
Change History
                                                      mit
                                                 ...
GitMathematics




45
Directed Acyclic Graph
       a32



             2e2



     8b3


             4e8
Directed Acyclic Graph
                         Ann’s Feature
       a32         5fa



             2e2



     8b3


   ...
Directed Acyclic Graph
                         Ann’s Feature
       a32         5fa



             2e2



     8b3


   ...
Directed Acyclic Graph
                          Ann’s Feature
       a32         5fa


                          Tim’s Fe...
Directed Acyclic Graph
                               Ann’s Feature
       a32         5fa


                             ...
Directed Acyclic Graph
                               Ann’s Feature
       a32         5fa


                             ...
WorkingOffline

47
Offline Anything
      Checkin




48
Offline Anything
      Checkin
      Add
      Branch
      List change log
      Grep history
      Rewrite history
     ...
Offline Anything
      Checkin
      Add
      Branch
      List change log
      Grep history
      Rewrite history
     ...
Offline Anything
      Checkin
      Add
      Branch
      List change log
      Grep history
      Rewrite history
     ...
Hooray! Another
checkin to my latest OSS
        project!
Hooray! Another
             checkin to my latest OSS
                     project!




   I think I liked
subversion bett...
UsageModels




50
Centralized
Central
 Repo
Centralized
Central
 Repo
Repo
               Blessed




Dictatorship
Repo
               Blessed




Dictatorship
Repo
               Blessed




Dictatorship
Repo
               Blessed




Dictatorship
Repo
               Blessed




Dictatorship
Certified




                         Integration Managed
           Development
 Repo         Repo
Certified




                         Integration Managed
           Development
 Repo         Repo
Certified




                         Integration Managed
           Development
 Repo         Repo
Certified




                         Integration Managed
           Development
 Repo         Repo
Mirror           Mirror

Certified       Development
 Repo             Repo




                                Mirrored
Mirror           Mirror

Certified       Development
 Repo             Repo




                                Mirrored
Mirror           Mirror

Certified       Development
 Repo             Repo




                                Mirrored
Mirror           Mirror

Certified       Development
 Repo             Repo




                                Mirrored
Mirror           Mirror

Certified       Development
 Repo             Repo




                                Mirrored
☚ Private            Public ☛




                   GitHub




Custom + Public Contrib
☚ Private            Public ☛




                   GitHub




Custom + Public Contrib
☚ Private               Public ☛




         Customized
                      GitHub




Custom + Public Contrib
☚ Private               Public ☛




         Customized
                      GitHub




Custom + Public Contrib
☚ Private               Public ☛




         Customized
                      GitHub




Custom + Public Contrib
Speed
56
Init               Add               Status               Diff
                                                           ...
Sharing


58
Serving It Up
     Network
     ‣ git instaweb. Built in, read-only, HTTP.
     ‣ git daemon. Custom socket language.
    ...
60
61
Serving It Up

     Filesystem
     ‣ Local folders. Yes, they can be “remotes.”
     ‣ Mapped network drives. Just like f...
on
                                                     aem
                                                 it d
        ...
on
                                                     aem
                                                 it d
        ...
on
                                                      aem
                                                  it d
      ...
on
                                                          aem
                                                      it ...
on
                                                          aem
                                                      it ...
VCS Interop


64
Serversion
     git svn clone http://unfurl.com/trunk
     git svn dcommit


     ‣ First class compatibility.
     ‣ Roun...
66
GUIs

67
GitX




68
gitSafe




69
GitK




70
GitGUI




71
6
reasons
Cherry Pick



              ❻
     ‣git cherry-pick a5b2ee




73
Cherry Pick



                  ❻
     ‣git cherry-pick a5b2ee
     ‣Merge in just one commit.




73
Cherry Pick



                  ❻
     ‣git cherry-pick a5b2ee
     ‣Merge in just one commit.
     ‣When you want a nugg...
Gives Credit



                  ❺
     ‣Tracks who authors a change.




74
Gives Credit



                  ❺
     ‣Tracks who authors a change.
     ‣“Author” even survives passing through review...
Gives Credit



                   ❺
     ‣Tracks who authors a change.
     ‣“Author” even survives passing through revie...
Gives Credit



                   ❺
     ‣Tracks who authors a change.
     ‣“Author” even survives passing through revie...
Bisect Bugs



              ❹
     ‣git bisect run mvn test




75
Bisect Bugs



                   ❹
     ‣git bisect run mvn test
     ‣Binary-search for bug.




75
Bisect Bugs



                   ❹
     ‣git bisect run mvn test
     ‣Binary-search for bug.
     ‣Manual or automated m...
Bisect Bugs



                   ❹
     ‣git bisect run mvn test
     ‣Binary-search for bug.
     ‣Manual or automated m...
Squash Verbosity



              ❸
     ‣git merge --squash mybranch




76
Squash Verbosity



                  ❸
     ‣git merge --squash mybranch
     ‣Reduce all your micro-checkins to block co...
Squash Verbosity



                   ❸
     ‣git merge --squash mybranch
     ‣Reduce all your micro-checkins to block c...
Squash Verbosity



                   ❸
     ‣git merge --squash mybranch
     ‣Reduce all your micro-checkins to block c...
Search History



              ❷
     ‣git grep SomeText HEAD^^^




77
Search History



                   ❷
     ‣git grep SomeText HEAD^^^
     ‣Search in file history without checkout.




77
Search History



                   ❷
     ‣git grep SomeText HEAD^^^
     ‣Search in file history without checkout.
     ...
Rebase



              ❶
     ‣git rebase master




78
Rebase



                   ❶
     ‣git rebase master
     ‣Reposition your feature branch’s start point.




78
Rebase



                   ❶
     ‣git rebase master
     ‣Reposition your feature branch’s start point.
     ‣Makes for...
Rebase



                   ❶
     ‣git rebase master
     ‣Reposition your feature branch’s start point.
     ‣Makes for...
79
Tomorrow’s VCS, Today
tthew
                                 Ma
     Twitter
      @matthewmccull
     Blog
      http://www.ambientideas.com/bl...
Resources
     Git Homepage
     http://git-scm.com

     Directed Acrylic Graph
     http://en.wikipedia.org/wiki/Directe...
Resources
     Git Docs
     http://www.kernel.org/pub/software/scm/git/docs/

     Git Magic eBook
     http://www-cs-stu...
Resources
     MSysGit
     http://code.google.com/p/msysgit

     Git Cheetah
     http://code.google.com/p/msysgit/wiki/...
Image Credits
     ‣   http://www.ambientideasphotography.com
     ‣   http://flickr.com/photos/lenore-m/2903856664/
     ‣...
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Git Going With DVCS v1.1
Upcoming SlideShare
Loading in …5
×

Git Going With DVCS v1.1

1,731 views
1,647 views

Published on

Matthew McCullough's presentation of Git, the new Distributed Version Control System to the Denver Java Users Group.

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

No Downloads
Views
Total views
1,731
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
0
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

Git Going With DVCS v1.1

  1. 1. Git going DVCS with n bending mental spoo minutes of 90 ode control ia source c v 1 by Matthew McCullough of Ambient Ideas, LLC
  2. 2. “ Git -noun sant or unplea Slang. an British ” per son emptible cont ionar y rd English Dict -Oxfo 2
  3. 3. astard, and otistical b “ I'm an eg projects all my I name yself. Fi rst Linux, after m git. ” now us Torvalds -Lin
  4. 4. RCS Folders
  5. 5. Clear Source Case Safe CVS PVCS RCS Folders
  6. 6. Subversion BitKeeper Perforce Clear Source Case Safe CVS PVCS RCS Folders
  7. 7. darcs Mercurial Bazaar Subversion BitKeeper Perforce Clear Source Case Safe CVS PVCS RCS Folders
  8. 8. t Source Code Control Gi
  9. 9. Gi Source Code Control t
  10. 10. CultureChange 8
  11. 11. =Don’t Centralized VCS
  12. 12. Innovate 16
  13. 13. Experiment 16
  14. 14. Safely Be Wrong 16
  15. 15. Drive-by Assist 16
  16. 16. Crowd Source 16
  17. 17. 18
  18. 18. 19
  19. 19. Global Git Settings git config --global user.name quot;Hal Smithquot; 20
  20. 20. Global Git Settings git config --global user.name quot;Hal Smithquot; git config --global user.email quot;hal@bnl.comquot; 20
  21. 21. Global Git Settings git config --global user.name quot;Hal Smithquot; git config --global user.email quot;hal@bnl.comquot; ues val ent urr tc tpu Ou git config --list 20
  22. 22. Creating a Repo mkdir myproj.git 21
  23. 23. Creating a Repo mkdir myproj.git cd myproj.git 21
  24. 24. Creating a Repo mkdir myproj.git cd myproj.git lks! t fo ’s i hat git init T 21
  25. 25. 22
  26. 26. 22
  27. 27. Who’s Got Git? 23
  28. 28. Hashes and Integrity 28
  29. 29. SHA-1 Hash Index vs. Hash ‣ Centralized VCS uses DB auto-increment index. ‣ Git uses SHA-1 hash. ‣ Hash for the sake of integrity. Hashable Objects ‣ Blob ‣ Tree ‣ Commit ‣ Tag 29
  30. 30. SHA-1 Hash Index vs. Hash ‣ Centralized VCS uses DB auto-increment index. ‣ Git uses SHA-1 hash. ‣ Hash for the sake of integrity. Hashable Objects ght hou It ere ‣ Blob es w ash h ‣ Tree for rds? ‣ Commit swo pas ‣ Tag 29
  31. 31. http://book.git-scm.com/1_the_git_object_model.html 30
  32. 32. http://book.git-scm.com/1_the_git_object_model.html 30
  33. 33. http://book.git-scm.com/1_the_git_object_model.html 30
  34. 34. http://book.git-scm.com/1_the_git_object_model.html 30
  35. 35. alized entr C Alice Bob
  36. 36. alized entr C Alice Bob 1 = okay.htm
  37. 37. alized entr C Alice Bob 1 = okay.htm 2 = fine.htm
  38. 38. alized entr C Alice Bob 1 = okay.htm 2 = fine.htm Sync
  39. 39. alized entr C Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm 2 = fine.htm Sync
  40. 40. alized entr C Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm 2 = fine.htm Sync 3 = good.htm
  41. 41. alized entr C Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm 2 = fine.htm Sync 3 = good.htm 3 = great.htm
  42. 42. alized entr C Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm 2 = fine.htm Sync 3 = good.htm Sync 3 = great.htm
  43. 43. alized entr C Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm 2 = fine.htm Sync 4 = good.htm 3 = good.htm Sync 3 = great.htm 4 = great.htm
  44. 44. alized entr C Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm 2 = fine.htm Sync ERROR 4 = good.htm 3 = good.htm ERROR Sync 3 = great.htm 4 = great.htm
  45. 45. Distributed Alice Bob
  46. 46. Distributed Alice Bob a233b76 = okay.htm
  47. 47. Distributed Alice Bob a233b76 = okay.htm d234ab1 = fine.htm
  48. 48. Distributed Alice Bob a233b76 = okay.htm d234ab1 = fine.htm Sync
  49. 49. Distributed Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm d234ab1 = fine.htm Sync
  50. 50. Distributed Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm d234ab1 = fine.htm Sync f90b12c = good.htm
  51. 51. Distributed Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm d234ab1 = fine.htm Sync f90b12c = good.htm ae42ba0 = great.htm
  52. 52. Distributed Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm d234ab1 = fine.htm Sync f90b12c = good.htm Sync ae42ba0 = great.htm
  53. 53. Distributed Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm d234ab1 = fine.htm Sync f90b12c = good.htm f90b12c = good.htm Sync ae42ba0 = great.htm ae42ba0 = great.htm
  54. 54. Hash Benefits Integrity ‣ Identifies damaged repos. ‣ Prevents modification of published history. ‣ Unique to file size and contents. Tags ‣ Cryptographically sign tags by GPG/email. Independence ‣ Separation from sequence # of checkin. 35
  55. 55. Location,Location,Location 36
  56. 56. Remote is like a special Stash Repo Index Working
  57. 57. Remote is like a special Stash Repo Index Working
  58. 58. Remote is like a special Stash Repo git clone Index Working
  59. 59. Remote is like a special Stash Repo git clone git checkout Index Working
  60. 60. Remote is like a special Stash Repo git clone git checkout edit some files Index Working
  61. 61. Remote is like a special Stash Repo git clone git checkout edit some files git stash Index Working
  62. 62. Remote is like a special Stash Repo git clone git checkout edit some files git stash edit some files Index Working
  63. 63. Remote is like a special Stash Repo git clone git checkout edit some files git stash edit some files Index git stash apply Working
  64. 64. Remote is like a special Stash Repo git clone git checkout edit some files git stash edit some files Index git stash apply Working git add
  65. 65. Remote is like a special Stash Repo git clone git checkout edit some files git stash edit some files Index git stash apply Working git add git commit
  66. 66. Remote is like a special Stash Repo git clone git checkout edit some files git stash edit some files Index git stash apply Working git add git commit git push
  67. 67. Remote is like a special Stash Repo git clone git checkout edit some files git stash edit some files Index git stash apply Working git add git commit git push
  68. 68. repo uild B git clone git://somedomain/myproj.git cd myproj.git 38
  69. 69. repo uild B git clone git://somedomain/myproj.git cd myproj.git dex te in pda U git checkout master 38
  70. 70. repo uild B git clone git://somedomain/myproj.git cd myproj.git dex te in pda U git checkout master king echo ‘//Comments’ >> ClassOne.java or dit w echo ‘//Thoughts’ >> ClassTwo.java E 38
  71. 71. repo uild B git clone git://somedomain/myproj.git cd myproj.git dex te in pda U git checkout master king echo ‘//Comments’ >> ClassOne.java or dit w echo ‘//Thoughts’ >> ClassTwo.java E ndex to i Add epo git add ClassOne.java to r ave comments’ S git commit -m’Added 38
  72. 72. repo uild B git clone git://somedomain/myproj.git cd myproj.git dex te in pda U git checkout master king echo ‘//Comments’ >> ClassOne.java or dit w echo ‘//Thoughts’ >> ClassTwo.java E ndex to i Add epo git add ClassOne.java to r ave commit -m’Added comments’ S git ash st h to stash Pus git 38
  73. 73. Single Stage Thinking Subversion svn commit ‣ ‣ Adds everything modified. ‣ Must list if you want specific files. ‣ What if you check in your password? 39
  74. 74. $ echo //password >> Matt1.java $ echo //password >> Matt2.java 40
  75. 75. $ echo //password >> Matt1.java $ echo //password >> Matt2.java $ svn status M Matt1.java M Matt2.java 40
  76. 76. $ echo //password >> Matt1.java $ echo //password >> Matt2.java $ svn status M Matt1.java M Matt2.java $ svn commit -m'Matts checkin' Adding Matt1.java Adding Matt2.java Transmitting file data . Committed revision 2. 40
  77. 77. Three Stage Thinking Git git add ‣ git commit ‣ git push ‣ ‣ Commits only what is added to the index. ‣ Opportunity to change history locally. ‣ Selectively share with other repos. 41
  78. 78. $ echo //SECRETPASSWORD >> mattfile1.java $ echo //NewText2 >> mattfile2.java 42
  79. 79. $ echo //SECRETPASSWORD >> mattfile1.java $ echo //NewText2 >> mattfile2.java $ git status # On branch master # Changed but not updated: # modified: mattfile1.txt # modified: mattfile2.txt 42
  80. 80. $ echo //SECRETPASSWORD >> mattfile1.java $ echo //NewText2 >> mattfile2.java $ git status # On branch master # Changed but not updated: # modified: mattfile1.txt # modified: mattfile2.txt dex o in int Put $ git add mattfile1.txt 42
  81. 81. $ echo //SECRETPASSWORD >> mattfile1.java $ echo //NewText2 >> mattfile2.java $ git status # On branch master # Changed but not updated: # modified: mattfile1.txt # modified: mattfile2.txt dex o in int Put $ git add mattfile1.txt epo to r ave S $ git commit -m'Matts pw checkin' [master]: created ddcdf18: quot;Matts changesquot; 1 files changed, 1 insertions(+), 0 deletions(-) 42
  82. 82. #$%^&! I just committed my password! 43
  83. 83. Change History $ git reset --hard HEAD^ HEAD is now at 9de4cd3 First checkin $ git log commit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993 Author: Matthew McCullough <matthewm@ambientideas.com> Date: Wed Mar 4 23:09:17 2009 -0700 First checkin 44
  84. 84. Change History mit com the way wa hro T $ git reset --hard HEAD^ HEAD is now at 9de4cd3 First checkin $ git log commit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993 Author: Matthew McCullough <matthewm@ambientideas.com> Date: Wed Mar 4 23:09:17 2009 -0700 First checkin 44
  85. 85. Change History mit com the way wa hro T $ git reset --hard HEAD^ HEAD is now at 9de4cd3 First checkin $ git log commit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993 Author: Matthew McCullough <matthewm@ambientideas.com> Date: Wed Mar 4 23:09:17 2009 -0700 First checkin 44
  86. 86. GitMathematics 45
  87. 87. Directed Acyclic Graph a32 2e2 8b3 4e8
  88. 88. Directed Acyclic Graph Ann’s Feature a32 5fa 2e2 8b3 4e8
  89. 89. Directed Acyclic Graph Ann’s Feature a32 5fa 2e2 8b3 4e8
  90. 90. Directed Acyclic Graph Ann’s Feature a32 5fa Tim’s Feature 2e2 d19 8b3 4e8
  91. 91. Directed Acyclic Graph Ann’s Feature a32 5fa Tim’s Feature 2e2 d19 Linus’ rewrite of Tim’s feature 8b3 e69 4e8
  92. 92. Directed Acyclic Graph Ann’s Feature a32 5fa Tim’s Feature 2e2 d19 Linus’ rewrite of Tim’s feature 8b3 e69 4e8
  93. 93. WorkingOffline 47
  94. 94. Offline Anything Checkin 48
  95. 95. Offline Anything Checkin Add Branch List change log Grep history Rewrite history Stash Merge Label Remove 48
  96. 96. Offline Anything Checkin Add Branch List change log Grep history Rewrite history Stash Merge Label Remove practically everything but push 48
  97. 97. Offline Anything Checkin Add Branch List change log Grep history Rewrite history Stash Merge Label Remove practically everything but push 48
  98. 98. Hooray! Another checkin to my latest OSS project!
  99. 99. Hooray! Another checkin to my latest OSS project! I think I liked subversion better...
  100. 100. UsageModels 50
  101. 101. Centralized Central Repo
  102. 102. Centralized Central Repo
  103. 103. Repo Blessed Dictatorship
  104. 104. Repo Blessed Dictatorship
  105. 105. Repo Blessed Dictatorship
  106. 106. Repo Blessed Dictatorship
  107. 107. Repo Blessed Dictatorship
  108. 108. Certified Integration Managed Development Repo Repo
  109. 109. Certified Integration Managed Development Repo Repo
  110. 110. Certified Integration Managed Development Repo Repo
  111. 111. Certified Integration Managed Development Repo Repo
  112. 112. Mirror Mirror Certified Development Repo Repo Mirrored
  113. 113. Mirror Mirror Certified Development Repo Repo Mirrored
  114. 114. Mirror Mirror Certified Development Repo Repo Mirrored
  115. 115. Mirror Mirror Certified Development Repo Repo Mirrored
  116. 116. Mirror Mirror Certified Development Repo Repo Mirrored
  117. 117. ☚ Private Public ☛ GitHub Custom + Public Contrib
  118. 118. ☚ Private Public ☛ GitHub Custom + Public Contrib
  119. 119. ☚ Private Public ☛ Customized GitHub Custom + Public Contrib
  120. 120. ☚ Private Public ☛ Customized GitHub Custom + Public Contrib
  121. 121. ☚ Private Public ☛ Customized GitHub Custom + Public Contrib
  122. 122. Speed 56
  123. 123. Init Add Status Diff Branch (Cold/Hot) git hg bzr git hg bzr git hg bzr git hg bzr Tag Log Commit (Lg) Commit (Sm) git c git h hg c hg h bzr c bzr h git hg bzr git hg bzr git hg bzr git hg bzr data from http://whygitisbetterthanx.com/#git-is-fast
  124. 124. Sharing 58
  125. 125. Serving It Up Network ‣ git instaweb. Built in, read-only, HTTP. ‣ git daemon. Custom socket language. ‣ gitosis. Easy permissions control. ‣ github. Open source & private repos. ‣ ssh. OS controlled permissions. 59
  126. 126. 60
  127. 127. 61
  128. 128. Serving It Up Filesystem ‣ Local folders. Yes, they can be “remotes.” ‣ Mapped network drives. Just like folders. 62
  129. 129. on aem it d g git clone git://somehost.org/myproj.git 63
  130. 130. on aem it d g git clone git://somehost.org/myproj.git SSH git clone mccm06@somehost.org:myproj.git 63
  131. 131. on aem it d g git clone git://somehost.org/myproj.git SSH git clone mccm06@somehost.org:myproj.git TTP H git clone http://somehost.org/myproj.git 63
  132. 132. on aem it d g git clone git://somehost.org/myproj.git SSH git clone mccm06@somehost.org:myproj.git TTP H git clone http://somehost.org/myproj.git tem sys File git clone ~/work/myproj.git 63
  133. 133. on aem it d g git clone git://somehost.org/myproj.git SSH git clone mccm06@somehost.org:myproj.git TTP H git clone http://somehost.org/myproj.git tem sys File git clone ~/work/myproj.git rive rk d two Ne git clone z:someservermyproj.git 63
  134. 134. VCS Interop 64
  135. 135. Serversion git svn clone http://unfurl.com/trunk git svn dcommit ‣ First class compatibility. ‣ Round trip support. ‣ Git commits = svn commits. 65
  136. 136. 66
  137. 137. GUIs 67
  138. 138. GitX 68
  139. 139. gitSafe 69
  140. 140. GitK 70
  141. 141. GitGUI 71
  142. 142. 6 reasons
  143. 143. Cherry Pick ❻ ‣git cherry-pick a5b2ee 73
  144. 144. Cherry Pick ❻ ‣git cherry-pick a5b2ee ‣Merge in just one commit. 73
  145. 145. Cherry Pick ❻ ‣git cherry-pick a5b2ee ‣Merge in just one commit. ‣When you want a nugget, not a branchload. 73
  146. 146. Gives Credit ❺ ‣Tracks who authors a change. 74
  147. 147. Gives Credit ❺ ‣Tracks who authors a change. ‣“Author” even survives passing through reviewers. 74
  148. 148. Gives Credit ❺ ‣Tracks who authors a change. ‣“Author” even survives passing through reviewers. ‣“Author” survives all merges. 74
  149. 149. Gives Credit ❺ ‣Tracks who authors a change. ‣“Author” even survives passing through reviewers. ‣“Author” survives all merges. ‣Additionally tracks who committed a change. 74
  150. 150. Bisect Bugs ❹ ‣git bisect run mvn test 75
  151. 151. Bisect Bugs ❹ ‣git bisect run mvn test ‣Binary-search for bug. 75
  152. 152. Bisect Bugs ❹ ‣git bisect run mvn test ‣Binary-search for bug. ‣Manual or automated modes. 75
  153. 153. Bisect Bugs ❹ ‣git bisect run mvn test ‣Binary-search for bug. ‣Manual or automated modes. ‣Yak cruelty-prevention. 75
  154. 154. Squash Verbosity ❸ ‣git merge --squash mybranch 76
  155. 155. Squash Verbosity ❸ ‣git merge --squash mybranch ‣Reduce all your micro-checkins to block commits. 76
  156. 156. Squash Verbosity ❸ ‣git merge --squash mybranch ‣Reduce all your micro-checkins to block commits. ‣Make mistakes, revise, checkin without hesitation. 76
  157. 157. Squash Verbosity ❸ ‣git merge --squash mybranch ‣Reduce all your micro-checkins to block commits. ‣Make mistakes, revise, checkin without hesitation. ‣Great for SVN compatibility. 76
  158. 158. Search History ❷ ‣git grep SomeText HEAD^^^ 77
  159. 159. Search History ❷ ‣git grep SomeText HEAD^^^ ‣Search in file history without checkout. 77
  160. 160. Search History ❷ ‣git grep SomeText HEAD^^^ ‣Search in file history without checkout. ‣Greps contents. 77
  161. 161. Rebase ❶ ‣git rebase master 78
  162. 162. Rebase ❶ ‣git rebase master ‣Reposition your feature branch’s start point. 78
  163. 163. Rebase ❶ ‣git rebase master ‣Reposition your feature branch’s start point. ‣Makes for simpler merge graphs. 78
  164. 164. Rebase ❶ ‣git rebase master ‣Reposition your feature branch’s start point. ‣Makes for simpler merge graphs. ‣Sustains feature-branch work clarity. 78
  165. 165. 79
  166. 166. Tomorrow’s VCS, Today
  167. 167. tthew Ma Twitter @matthewmccull Blog http://www.ambientideas.com/blog sidebar has all my social media links Email matthewm@ambientideas.com GitHub http://github.com/matthewmccullough 81
  168. 168. Resources Git Homepage http://git-scm.com Directed Acrylic Graph http://en.wikipedia.org/wiki/Directed_acyclic_graph Git for Computer Scientists http://eagain.net/articles/git-for-computer-scientists/ Git Treeish http://book.git-scm.com/4_git_treeishes.html 82
  169. 169. Resources Git Docs http://www.kernel.org/pub/software/scm/git/docs/ Git Magic eBook http://www-cs-students.stanford.edu/~blynn/gitmagic/book.pdf Linus Torvald’s Git talk at Google http://www.youtube.com/watch?v=4XpnKHJAok8 CygWin http://www.cygwin.com 83
  170. 170. Resources MSysGit http://code.google.com/p/msysgit Git Cheetah http://code.google.com/p/msysgit/wiki/GitCheetah Matthew’s Git Bookmarks http://delicious.com/matthew.mccullough/git Matthew’s Bash Prompt http://gist.github.com/47267 84
  171. 171. Image Credits ‣ http://www.ambientideasphotography.com ‣ http://flickr.com/photos/lenore-m/2903856664/ ‣ http://en.wikipedia.org/wiki/Git_(software) ‣ http://flickr.com/photos/karenhorton/1583513014/ ‣ http://flickr.com/photos/mashdnart/2545782407/ ‣ http://commons.wikimedia.org/wiki/ File:Small_Boy_nuclear_test_1962.jpg ‣ http://www.flickr.com/photos/knmurphy/2506896257/ ‣ http://www.flickr.com/photos/albyspace/1022035568/ ‣ http://flickr.com/photos/michaelhays/3070238360/ ‣ http://flickr.com/photos/d_vdm/509996632/ 85

×