SlideShare a Scribd company logo
1 of 201
Download to read offline
Git going
                   DVCS
         with
                            n bending
                mental spoo
   minutes of
90
                    ode control
        ia source c
      v



                           by Matthew McCullough of Ambient Ideas, LLC
“   Git
    -noun                    sant or
                      unplea
            Slang. an
    British
                                ”
                    per son
          emptible
    cont
                                  ionar y
                            rd English Dict
                      -Oxfo
astard, and
          otistical b
“
I'm an eg
                  projects
           all my
    I name
           yself. Fi rst Linux,
    after m
          git. ”
    now
                          us Torvalds
                     -Lin
RCS

Folders
Clear
           Source   Case
            Safe
                    CVS
           PVCS
     RCS

Folders
Subversion
                            BitKeeper

                                  Perforce
                    Clear
           Source   Case
            Safe
                    CVS
           PVCS
     RCS

Folders
darcs
                                                     Mercurial


                                                           Bazaar

                                        Subversion
                            BitKeeper

                                  Perforce
                    Clear
           Source   Case
            Safe
                    CVS
           PVCS
     RCS

Folders
t
Source Code Control
Gi
Gi
Source Code Control

      t
CultureChange
=Don’t
Centralized
      VCS
Innovate
Experiment
Safely Be Wrong
Drive-by Assist
Crowd Source
Global Git Settings

git config --global user.name quot;Hal Smithquot;
Global Git Settings

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

git config --global user.email quot;hal@bnl.comquot;
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
Creating a Repo

mkdir myproj.git
Creating a Repo

mkdir myproj.git
cd myproj.git
Creating a Repo

mkdir myproj.git
cd myproj.git
                          lks!
                      t fo
                 ’s i
             hat
git init   T
Who’s Got   Git?
Hashes and
      Integrity
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
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
http://book.git-scm.com/1_the_git_object_model.html
http://book.git-scm.com/1_the_git_object_model.html
http://book.git-scm.com/1_the_git_object_model.html
http://book.git-scm.com/1_the_git_object_model.html
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 = fine.htm
               Sync
alized
           entr
         C
  Alice                  Bob
1 = okay.htm          1 = okay.htm

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

2 = fine.htm            2 = fine.htm
                Sync
                       3 = good.htm

3 = great.htm
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
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
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
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           d234ab1 = fine.htm
                     Sync
Distributed
    Alice                        Bob
a233b76 = okay.htm          a233b76 = okay.htm

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

d234ab1 = fine.htm            d234ab1 = fine.htm
                      Sync
                             f90b12c = good.htm

ae42ba0 = great.htm
Distributed
     Alice                        Bob
a233b76 = okay.htm           a233b76 = okay.htm

d234ab1 = fine.htm            d234ab1 = fine.htm
                      Sync
                             f90b12c = good.htm

                      Sync
ae42ba0 = great.htm
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
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.
Location,Location,Location
Single Stage Thinking

Subversion
    svn commit
‣
‣   Adds everything modified.
‣   Must list if you want specific files.
‣   What if you check in your password?
$ echo //password >> Matt1.java
$ echo //password >> Matt2.java
$ echo //password >> Matt1.java
$ echo //password >> Matt2.java

$ svn status
M      Matt1.java
M      Matt2.java
$ 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.
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




                     Index
   Working
Remote
        is like a special
Stash
                            Repo
                                   git clone
                                   git checkout




                     Index
   Working
Remote
        is like a special
Stash
                            Repo
                                   git clone
                                   git checkout
                                   edit some files



                     Index
   Working
Remote
        is like a special
Stash
                            Repo
                                   git clone
                                   git checkout
                                   edit some files
                                   git stash

                     Index
   Working
Remote
        is like a special
Stash
                            Repo
                                   git clone
                                   git checkout
                                   edit some files
                                   git stash
                                   edit some files
                     Index
   Working
Remote
        is like a special
Stash
                            Repo
                                   git clone
                                   git checkout
                                   edit some files
                                   git stash
                                   edit some files
                     Index         git stash apply
   Working
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
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
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
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
repo
                                          uild
                                        B
git clone git://somedomain/myproj.git
cd myproj.git
repo
                                          uild
                                        B
git clone git://somedomain/myproj.git
cd myproj.git
                                  dex
                            te in
                        pda
                      U
git checkout master
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
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
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
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.
$ echo //SECRETPASSWORD >> mattfile1.txt
$ echo //NewText2 >> mattfile2.txt
$ echo //SECRETPASSWORD >> mattfile1.txt
$ echo //NewText2 >> mattfile2.txt

$ git status
# On branch master
# Changed but not updated:
#       modified:   mattfile1.txt
#       modified:   mattfile2.txt
$ echo //SECRETPASSWORD >> mattfile1.txt
$ echo //NewText2 >> mattfile2.txt

$ git status
# On branch master
# Changed but not updated:
#       modified:   mattfile1.txt
#       modified:   mattfile2.txt
                                       dex
                                  o in
                              int
                          Put
$ git add mattfile1.txt
$ echo //SECRETPASSWORD >> mattfile1.txt
$ echo //NewText2 >> mattfile2.txt

$ 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(-)
#$%^&!
I just committed my password!
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
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
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
GitMathematics
Directed Acyclic Graph
       a32



             2e2



     8b3


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



             2e2



     8b3


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



             2e2



     8b3


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


                          Tim’s Feature
             2e2    d19



     8b3


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


                               Tim’s Feature
             2e2    d19

                                   Linus’ rewrite of
                                     Tim’s feature
     8b3                 e69


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


                               Tim’s Feature
             2e2    d19

                                   Linus’ rewrite of
                                     Tim’s feature
     8b3                 e69


             4e8
Sharing
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.
Serving It Up

Filesystem
‣ Local folders. Yes, they can be “remotes.”
‣ Mapped network drives. Just like folders.
on
                                                aem
                                            it d
                                          g
git clone git://somehost.org/myproj.git
on
                                                aem
                                            it d
                                          g
git clone git://somehost.org/myproj.git
                                                   SSH
git clone mccm06@somehost.org:myproj.git
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
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
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
Merge & Rebase
Cheap Branches
Cheap Branches
git show-branch --all
git branch -a

‣Local branch
 ‣localbranchname
‣Remote
 ‣remote/branchname
Merge Anything
Merge Anything
git merge --no-commit <sourcebranch>
git merge --squash <sourcebranch>
git merge <sourcebranch1> <sourcebranch2>


‣Selectable merge strategy
‣Octopus: More than one
‣Review before committing
‣Flatten micro-checkins
Merge Strategies
Rebase for Clarity
Rebase for Clarity
git checkout myfeaturebranch
git rebase master

‣Cleaner history than a merge
‣Fast forwards original branch
‣Lets you see “how trunk will act” before you merge
WorkingOffline
Offline Anything
 Checkin
Offline Anything
 Checkin
 Add
 Branch
 List change log
 Grep history
 Rewrite history
 Stash
 Merge
 Label
 Remove
Offline Anything
 Checkin
 Add
 Branch
 List change log
 Grep history
 Rewrite history
 Stash
 Merge
 Label
 Remove
 practically everything but push
Offline Anything
 Checkin
 Add
 Branch
 List change log
 Grep history
 Rewrite history
 Stash
 Merge
 Label
 Remove
 practically everything but push
Hooray! Another
checkin to my latest OSS
        project!
Hooray! Another
             checkin to my latest OSS
                     project!




   I think I liked
subversion better...
Speed
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
VCS Interop
Subversion
git svn clone http://unfurl.com/trunk
git svn dcommit


‣ First class compatibility.
‣ Round trip support.
‣ Git commits = svn commits.
UsageModels
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
GUIs
GitX
gitSafe
GitK
GitGUI
6
reasons
Cherry Pick



         ❻
‣git cherry-pick a5b2ee
Cherry Pick



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



             ❻
‣git cherry-pick a5b2ee
‣Merge in just one commit.
‣When you want a nugget, not a branchload.
Gives Credit



             ❺
‣Tracks who authors a change.
Gives Credit



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



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



              ❺
‣Tracks who authors a change.
‣“Author” even survives passing through reviewers.
‣“Author” survives all merges.
‣Additionally tracks who committed a change.
Bisect Bugs



         ❹
‣git bisect run mvn test
Bisect Bugs



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



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



              ❹
‣git bisect run mvn test
‣Binary-search for bug.
‣Manual or automated modes.
‣Yak cruelty-prevention.
Squash Verbosity



         ❸
‣git merge --squash mybranch
Squash Verbosity



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



              ❸
‣git merge --squash mybranch
‣Reduce all your micro-checkins to block commits.
‣Make mistakes, revise, checkin without hesitation.
Squash Verbosity



              ❸
‣git merge --squash mybranch
‣Reduce all your micro-checkins to block commits.
‣Make mistakes, revise, checkin without hesitation.
‣Great for SVN compatibility.
Search History



         ❷
‣git grep SomeText HEAD^^^
Search History



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



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



         ❶
‣git rebase master
Rebase



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



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



              ❶
‣git rebase master
‣Reposition your feature branch’s start point.
‣Makes for simpler merge graphs.
‣Sustains feature-branch work clarity.
Tomorrow’s VCS, Today
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
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
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
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
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/

More Related Content

More from Matthew McCullough

Using Git and GitHub Effectively at Emerge Interactive
Using Git and GitHub Effectively at Emerge InteractiveUsing Git and GitHub Effectively at Emerge Interactive
Using Git and GitHub Effectively at Emerge InteractiveMatthew McCullough
 
All About GitHub Pull Requests
All About GitHub Pull RequestsAll About GitHub Pull Requests
All About GitHub Pull RequestsMatthew McCullough
 
Git Graphs, Hashes, and Compression, Oh My
Git Graphs, Hashes, and Compression, Oh MyGit Graphs, Hashes, and Compression, Oh My
Git Graphs, Hashes, and Compression, Oh MyMatthew McCullough
 
Git and GitHub at the San Francisco JUG
 Git and GitHub at the San Francisco JUG Git and GitHub at the San Francisco JUG
Git and GitHub at the San Francisco JUGMatthew McCullough
 
Migrating from Subversion to Git and GitHub
Migrating from Subversion to Git and GitHubMigrating from Subversion to Git and GitHub
Migrating from Subversion to Git and GitHubMatthew McCullough
 
Build Lifecycle Craftsmanship for the Transylvania JUG
Build Lifecycle Craftsmanship for the Transylvania JUGBuild Lifecycle Craftsmanship for the Transylvania JUG
Build Lifecycle Craftsmanship for the Transylvania JUGMatthew McCullough
 
Git Going for the Transylvania JUG
Git Going for the Transylvania JUGGit Going for the Transylvania JUG
Git Going for the Transylvania JUGMatthew McCullough
 
Transylvania JUG Pre-Meeting Announcements
Transylvania JUG Pre-Meeting AnnouncementsTransylvania JUG Pre-Meeting Announcements
Transylvania JUG Pre-Meeting AnnouncementsMatthew McCullough
 
Game Theory for Software Developers at the Boulder JUG
Game Theory for Software Developers at the Boulder JUGGame Theory for Software Developers at the Boulder JUG
Game Theory for Software Developers at the Boulder JUGMatthew McCullough
 
Cascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGCascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGMatthew McCullough
 

More from Matthew McCullough (20)

Using Git and GitHub Effectively at Emerge Interactive
Using Git and GitHub Effectively at Emerge InteractiveUsing Git and GitHub Effectively at Emerge Interactive
Using Git and GitHub Effectively at Emerge Interactive
 
All About GitHub Pull Requests
All About GitHub Pull RequestsAll About GitHub Pull Requests
All About GitHub Pull Requests
 
Adam Smith Builds an App
Adam Smith Builds an AppAdam Smith Builds an App
Adam Smith Builds an App
 
Git's Filter Branch Command
Git's Filter Branch CommandGit's Filter Branch Command
Git's Filter Branch Command
 
Git Graphs, Hashes, and Compression, Oh My
Git Graphs, Hashes, and Compression, Oh MyGit Graphs, Hashes, and Compression, Oh My
Git Graphs, Hashes, and Compression, Oh My
 
Git and GitHub at the San Francisco JUG
 Git and GitHub at the San Francisco JUG Git and GitHub at the San Francisco JUG
Git and GitHub at the San Francisco JUG
 
Finding Things in Git
Finding Things in GitFinding Things in Git
Finding Things in Git
 
Git and GitHub for RallyOn
Git and GitHub for RallyOnGit and GitHub for RallyOn
Git and GitHub for RallyOn
 
Migrating from Subversion to Git and GitHub
Migrating from Subversion to Git and GitHubMigrating from Subversion to Git and GitHub
Migrating from Subversion to Git and GitHub
 
Git Notes and GitHub
Git Notes and GitHubGit Notes and GitHub
Git Notes and GitHub
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Build Lifecycle Craftsmanship for the Transylvania JUG
Build Lifecycle Craftsmanship for the Transylvania JUGBuild Lifecycle Craftsmanship for the Transylvania JUG
Build Lifecycle Craftsmanship for the Transylvania JUG
 
Git Going for the Transylvania JUG
Git Going for the Transylvania JUGGit Going for the Transylvania JUG
Git Going for the Transylvania JUG
 
Transylvania JUG Pre-Meeting Announcements
Transylvania JUG Pre-Meeting AnnouncementsTransylvania JUG Pre-Meeting Announcements
Transylvania JUG Pre-Meeting Announcements
 
Game Theory for Software Developers at the Boulder JUG
Game Theory for Software Developers at the Boulder JUGGame Theory for Software Developers at the Boulder JUG
Game Theory for Software Developers at the Boulder JUG
 
Cascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGCascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUG
 
JQuery Mobile
JQuery MobileJQuery Mobile
JQuery Mobile
 
R Data Analysis Software
R Data Analysis SoftwareR Data Analysis Software
R Data Analysis Software
 
Please, Stop Using Git
Please, Stop Using GitPlease, Stop Using Git
Please, Stop Using Git
 
Dr. Strangedev
Dr. StrangedevDr. Strangedev
Dr. Strangedev
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 

Git Going With DVCS v1.3

  • 1. Git going DVCS with n bending mental spoo minutes of 90 ode control ia source c v by Matthew McCullough of Ambient Ideas, LLC
  • 2. Git -noun sant or unplea Slang. an British ” per son emptible cont ionar y rd English Dict -Oxfo
  • 3.
  • 4.
  • 5. astard, and otistical b “ I'm an eg projects all my I name yself. Fi rst Linux, after m git. ” now us Torvalds -Lin
  • 6.
  • 8. Clear Source Case Safe CVS PVCS RCS Folders
  • 9. Subversion BitKeeper Perforce Clear Source Case Safe CVS PVCS RCS Folders
  • 10. darcs Mercurial Bazaar Subversion BitKeeper Perforce Clear Source Case Safe CVS PVCS RCS Folders
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 28.
  • 29.
  • 30.
  • 31. Global Git Settings git config --global user.name quot;Hal Smithquot;
  • 32. Global Git Settings git config --global user.name quot;Hal Smithquot; git config --global user.email quot;hal@bnl.comquot;
  • 33. 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
  • 34. Creating a Repo mkdir myproj.git
  • 35. Creating a Repo mkdir myproj.git cd myproj.git
  • 36. Creating a Repo mkdir myproj.git cd myproj.git lks! t fo ’s i hat git init T
  • 37.
  • 38.
  • 39. Who’s Got Git?
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46. Hashes and Integrity
  • 47. 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
  • 48. 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
  • 53.
  • 54. alized entr C Alice Bob
  • 55. alized entr C Alice Bob 1 = okay.htm
  • 56. alized entr C Alice Bob 1 = okay.htm 2 = fine.htm
  • 57. alized entr C Alice Bob 1 = okay.htm 2 = fine.htm Sync
  • 58. alized entr C Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm 2 = fine.htm Sync
  • 59. alized entr C Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm 2 = fine.htm Sync 3 = good.htm
  • 60. alized entr C Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm 2 = fine.htm Sync 3 = good.htm 3 = great.htm
  • 61. 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
  • 62. 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
  • 63. 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
  • 64.
  • 66. Distributed Alice Bob a233b76 = okay.htm
  • 67. Distributed Alice Bob a233b76 = okay.htm d234ab1 = fine.htm
  • 68. Distributed Alice Bob a233b76 = okay.htm d234ab1 = fine.htm Sync
  • 69. Distributed Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm d234ab1 = fine.htm Sync
  • 70. Distributed Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm d234ab1 = fine.htm Sync f90b12c = good.htm
  • 71. Distributed Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm d234ab1 = fine.htm Sync f90b12c = good.htm ae42ba0 = great.htm
  • 72. Distributed Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm d234ab1 = fine.htm Sync f90b12c = good.htm Sync ae42ba0 = great.htm
  • 73. 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
  • 74. 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.
  • 76. Single Stage Thinking Subversion svn commit ‣ ‣ Adds everything modified. ‣ Must list if you want specific files. ‣ What if you check in your password?
  • 77. $ echo //password >> Matt1.java $ echo //password >> Matt2.java
  • 78. $ echo //password >> Matt1.java $ echo //password >> Matt2.java $ svn status M Matt1.java M Matt2.java
  • 79. $ 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.
  • 80. Remote is like a special Stash Repo Index Working
  • 81. Remote is like a special Stash Repo Index Working
  • 82. Remote is like a special Stash Repo git clone Index Working
  • 83. Remote is like a special Stash Repo git clone git checkout Index Working
  • 84. Remote is like a special Stash Repo git clone git checkout edit some files Index Working
  • 85. Remote is like a special Stash Repo git clone git checkout edit some files git stash Index Working
  • 86. Remote is like a special Stash Repo git clone git checkout edit some files git stash edit some files Index Working
  • 87. Remote is like a special Stash Repo git clone git checkout edit some files git stash edit some files Index git stash apply Working
  • 88. 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
  • 89. 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
  • 90. 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
  • 91. 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
  • 92. repo uild B git clone git://somedomain/myproj.git cd myproj.git
  • 93. repo uild B git clone git://somedomain/myproj.git cd myproj.git dex te in pda U git checkout master
  • 94. 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
  • 95. 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
  • 96. 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
  • 97. 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.
  • 98. $ echo //SECRETPASSWORD >> mattfile1.txt $ echo //NewText2 >> mattfile2.txt
  • 99. $ echo //SECRETPASSWORD >> mattfile1.txt $ echo //NewText2 >> mattfile2.txt $ git status # On branch master # Changed but not updated: # modified: mattfile1.txt # modified: mattfile2.txt
  • 100. $ echo //SECRETPASSWORD >> mattfile1.txt $ echo //NewText2 >> mattfile2.txt $ git status # On branch master # Changed but not updated: # modified: mattfile1.txt # modified: mattfile2.txt dex o in int Put $ git add mattfile1.txt
  • 101. $ echo //SECRETPASSWORD >> mattfile1.txt $ echo //NewText2 >> mattfile2.txt $ 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(-)
  • 102. #$%^&! I just committed my password!
  • 103. 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
  • 104. 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
  • 105. 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
  • 107. Directed Acyclic Graph a32 2e2 8b3 4e8
  • 108. Directed Acyclic Graph Ann’s Feature a32 5fa 2e2 8b3 4e8
  • 109. Directed Acyclic Graph Ann’s Feature a32 5fa 2e2 8b3 4e8
  • 110. Directed Acyclic Graph Ann’s Feature a32 5fa Tim’s Feature 2e2 d19 8b3 4e8
  • 111. Directed Acyclic Graph Ann’s Feature a32 5fa Tim’s Feature 2e2 d19 Linus’ rewrite of Tim’s feature 8b3 e69 4e8
  • 112. Directed Acyclic Graph Ann’s Feature a32 5fa Tim’s Feature 2e2 d19 Linus’ rewrite of Tim’s feature 8b3 e69 4e8
  • 114. 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.
  • 115.
  • 116.
  • 117. Serving It Up Filesystem ‣ Local folders. Yes, they can be “remotes.” ‣ Mapped network drives. Just like folders.
  • 118. on aem it d g git clone git://somehost.org/myproj.git
  • 119. on aem it d g git clone git://somehost.org/myproj.git SSH git clone mccm06@somehost.org:myproj.git
  • 120. 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
  • 121. 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
  • 122. 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
  • 125. Cheap Branches git show-branch --all git branch -a ‣Local branch ‣localbranchname ‣Remote ‣remote/branchname
  • 127. Merge Anything git merge --no-commit <sourcebranch> git merge --squash <sourcebranch> git merge <sourcebranch1> <sourcebranch2> ‣Selectable merge strategy ‣Octopus: More than one ‣Review before committing ‣Flatten micro-checkins
  • 130. Rebase for Clarity git checkout myfeaturebranch git rebase master ‣Cleaner history than a merge ‣Fast forwards original branch ‣Lets you see “how trunk will act” before you merge
  • 133. Offline Anything Checkin Add Branch List change log Grep history Rewrite history Stash Merge Label Remove
  • 134. Offline Anything Checkin Add Branch List change log Grep history Rewrite history Stash Merge Label Remove practically everything but push
  • 135. Offline Anything Checkin Add Branch List change log Grep history Rewrite history Stash Merge Label Remove practically everything but push
  • 136.
  • 137. Hooray! Another checkin to my latest OSS project!
  • 138. Hooray! Another checkin to my latest OSS project! I think I liked subversion better...
  • 139. Speed
  • 140. 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
  • 142. Subversion git svn clone http://unfurl.com/trunk git svn dcommit ‣ First class compatibility. ‣ Round trip support. ‣ Git commits = svn commits.
  • 143.
  • 147. Repo Blessed Dictatorship
  • 148. Repo Blessed Dictatorship
  • 149. Repo Blessed Dictatorship
  • 150. Repo Blessed Dictatorship
  • 151. Repo Blessed Dictatorship
  • 152. Certified Integration Managed Development Repo Repo
  • 153. Certified Integration Managed Development Repo Repo
  • 154. Certified Integration Managed Development Repo Repo
  • 155. Certified Integration Managed Development Repo Repo
  • 156. Mirror Mirror Certified Development Repo Repo Mirrored
  • 157. Mirror Mirror Certified Development Repo Repo Mirrored
  • 158. Mirror Mirror Certified Development Repo Repo Mirrored
  • 159. Mirror Mirror Certified Development Repo Repo Mirrored
  • 160. Mirror Mirror Certified Development Repo Repo Mirrored
  • 161. ☚ Private Public ☛ GitHub Custom + Public Contrib
  • 162. ☚ Private Public ☛ GitHub Custom + Public Contrib
  • 163. ☚ Private Public ☛ Customized GitHub Custom + Public Contrib
  • 164. ☚ Private Public ☛ Customized GitHub Custom + Public Contrib
  • 165. ☚ Private Public ☛ Customized GitHub Custom + Public Contrib
  • 166. GUIs
  • 167. GitX
  • 169. GitK
  • 170. GitGUI
  • 171.
  • 173. Cherry Pick ❻ ‣git cherry-pick a5b2ee
  • 174. Cherry Pick ❻ ‣git cherry-pick a5b2ee ‣Merge in just one commit.
  • 175. Cherry Pick ❻ ‣git cherry-pick a5b2ee ‣Merge in just one commit. ‣When you want a nugget, not a branchload.
  • 176. Gives Credit ❺ ‣Tracks who authors a change.
  • 177. Gives Credit ❺ ‣Tracks who authors a change. ‣“Author” even survives passing through reviewers.
  • 178. Gives Credit ❺ ‣Tracks who authors a change. ‣“Author” even survives passing through reviewers. ‣“Author” survives all merges.
  • 179. Gives Credit ❺ ‣Tracks who authors a change. ‣“Author” even survives passing through reviewers. ‣“Author” survives all merges. ‣Additionally tracks who committed a change.
  • 180. Bisect Bugs ❹ ‣git bisect run mvn test
  • 181. Bisect Bugs ❹ ‣git bisect run mvn test ‣Binary-search for bug.
  • 182. Bisect Bugs ❹ ‣git bisect run mvn test ‣Binary-search for bug. ‣Manual or automated modes.
  • 183. Bisect Bugs ❹ ‣git bisect run mvn test ‣Binary-search for bug. ‣Manual or automated modes. ‣Yak cruelty-prevention.
  • 184. Squash Verbosity ❸ ‣git merge --squash mybranch
  • 185. Squash Verbosity ❸ ‣git merge --squash mybranch ‣Reduce all your micro-checkins to block commits.
  • 186. Squash Verbosity ❸ ‣git merge --squash mybranch ‣Reduce all your micro-checkins to block commits. ‣Make mistakes, revise, checkin without hesitation.
  • 187. Squash Verbosity ❸ ‣git merge --squash mybranch ‣Reduce all your micro-checkins to block commits. ‣Make mistakes, revise, checkin without hesitation. ‣Great for SVN compatibility.
  • 188. Search History ❷ ‣git grep SomeText HEAD^^^
  • 189. Search History ❷ ‣git grep SomeText HEAD^^^ ‣Search in file history without checkout.
  • 190. Search History ❷ ‣git grep SomeText HEAD^^^ ‣Search in file history without checkout. ‣Greps contents.
  • 191. Rebase ❶ ‣git rebase master
  • 192. Rebase ❶ ‣git rebase master ‣Reposition your feature branch’s start point.
  • 193. Rebase ❶ ‣git rebase master ‣Reposition your feature branch’s start point. ‣Makes for simpler merge graphs.
  • 194. Rebase ❶ ‣git rebase master ‣Reposition your feature branch’s start point. ‣Makes for simpler merge graphs. ‣Sustains feature-branch work clarity.
  • 195.
  • 197. 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
  • 198. 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
  • 199. 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
  • 200. 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
  • 201. 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/