• Like
  • Save
Git Going with DVCS v1.6.0
Upcoming SlideShare
Loading in...5
×
 

Git Going with DVCS v1.6.0

on

  • 2,060 views

Git introduction to the Dallas Java MUG

Git introduction to the Dallas Java MUG

Statistics

Views

Total Views
2,060
Views on SlideShare
2,057
Embed Views
3

Actions

Likes
7
Downloads
0
Comments
0

2 Embeds 3

http://www.linkedin.com 2
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Git Going with DVCS v1.6.0 Git Going with DVCS v1.6.0 Presentation Transcript

    • Git going with DVCS nutes oc 90 mi ol magi f source code contr by Matthew McCullough of Ambient Ideas, LLC
    • MatthewMcCullough
    • http://ambientideas.com/blog
    • http://presentationpatterns.com
    • http://orei.ly/ogitvid
    • http://www.wakaleo.com/books/continuous- integration-with-hudson-the-book
    • http://delicious.com/matthew.mccullough/git
    • Git
    • “Cool kids” version control system
    • Open Source
    • bash scripts C code
    • “ Git -noun asa nt ish Sla ng. an u nple Brit er son” cont empt ible p or English D ictionar y -Oxford
    • otistical b astard, and“Im an eg I name all my projects after myself. Fi rst Linux, now git. ” -Lin us Torvalds
    • CertifiedGit User
    • 145+ commands
    • 18 used ona daily basis
    • init checkout bisectlog revert clonerebase pack diffmerge pull grepcommit push tagadd status branch
    • Distributed Version Control A new idea?
    • 1997code co-op
    • 2001 arch
    • 2003monotone
    • 2003 SVK
    • 2003 darcs
    • 2005bazaar
    • 2005mercurial
    • 2005 git
    • Why?
    • m s ste l sy tro Subversion on n c rsio Perforce veSource d Clear ize Safe Case a l CVS t r PVCS e n RCSC Folders
    • “ hated it with a p assion... ...no w ay to do C VS right. -Linu s Torvalds ”
    • Why switch to Git ?
    • Safely Be Wrong Experiment Innovate Drive-by AssistCrowd Source
    • and...
    • integration builds
    • integration builds
    • Hashes and Git
    • Index vs Hash‣ Centralized VCS uses DB sequential index.
    • Index vs Hash‣ Git uses SHA-1 hash.
    • 40 hex characters
    • 9AB223D28B1AA46EF1780B22F304982E39872C34
    • use as little of it as is unique
    • 9AB223D28B1AA46EF1780B22F304982E39872C34
    • 9AB223D28B1AA46EF1780B22F304982E39872C34
    • treeish
    • treeish = shorthand for hashes
    • 9AB223
    • 9AB223^
    • HEAD
    • HEAD^
    • HEAD~3
    • --since="2 weeks ago"
    • 9AB223..56CD77
    • Hashable Objects‣ Blob‣ Tree‣ Commit‣ Tag
    • 8d162 c67db commit 7e8b1 blob 7D 8D B3 7F BD 12 9F E9 a10b3 tree 7B 78 9D 3F 5C A6 72 CBtree:parent:author: a10b3 nil Fird tree blob: 8d162 logo.jpgcommitter: Matthew 51d22 blob: 51d22 draw.jsmessage:Major refactoring tree: blob: 7e8b1 web 9ab16 index.html blobof the web content. //Some more javascript 9ab16 var renderSize <html> blob <body></body> </html>
    • Distributedconnectivity
    • developer A
    • developer A developer B
    • developer A developer B
    • developer A developer B
    • blessed repodeveloper A developer B
    • Three Stage Thinking
    • Working Staging Repo checkout add commit Three stage thinking
    • RemoteStash Repo Index Working
    • RemoteStash Repo Index Working
    • RemoteStash Repo git clone Index Working
    • RemoteStash Repo git clone git checkout Index Working
    • RemoteStash Repo git clone git checkout edit project files Index Working
    • RemoteStash Repo git clone git checkout edit project files boss interrupts git stash Index Working
    • RemoteStash Repo git clone git checkout edit project files boss interrupts git stash test bug on master Index working as designed Working
    • RemoteStash Repo git clone git checkout edit project files boss interrupts git stash test bug on master Index working as designed git stash apply Working
    • RemoteStash Repo git clone git checkout edit project files boss interrupts git stash test bug on master Index working as designed git stash apply Working git add
    • RemoteStash Repo git clone git checkout edit project files boss interrupts git stash test bug on master Index working as designed git stash apply Working git add git commit
    • RemoteStash Repo git clone git checkout edit project files boss interrupts git stash test bug on master Index working as designed git stash apply Working git add git commit git push
    • WorkingOffline
    • More available connectivity
    • More available connectivity
    • More demand to work without connectivity
    • More demand to work without connectivity
    • Offline Anything Checkin
    • 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
    • Matthew: Cool! Another commit to mylatest OSS project using Git!
    • Matthew: Cool! Another commit to my latest OSS project using Git!Madelaine: I like subversionmuch better...
    • Storage Mechanics
    • Typical SCMs use deltas
    • v1 v2 v3 v4 v5File A File A File AFile B File B File B File B File BFile C File C Storage
    • CVS / Subversion / darcs / Mercurial
    • Checkin ckin kin in Chec kin he ck ec C he in in Ch C ck k C he h ec kin C ec ec kinDelta storage gets slower as the hhistory Ch C Checkin of a file gets longer Checkin
    • Git uses Directed Acyclic Graph storage (DAG)
    • cp -r srcfolder srcfolder.prev
    • Copy of the entire tree per checkin
    • zlib deflates every blob at commit
    • symlinks to existing identical blobs
    • v1 v2 v3 v4 v5File A File A File A File A File AFile B File B File B File B File BFile C File C File C File C File C Storage
    • 400MB Subversion repo convert to a 70MB Git repo
    • Speed
    • http://whygitisbetterthanx.com
    • 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 hgit hg bzr git hg bzr git hg bzr git hg bzr data from http://whygitisbetterthanx.com/#git-is-fast
    • Init Status Diff Branchgit svn git svn git svn Tag Log Commit (Lg) Commit (Sm) git c svn cgit svn git svn git svn git svn data from http://whygitisbetterthanx.com/#git-is-fast
    • 10 to 100 times Faster
    • Branch, Merge & Rebase
    • Branch
    • Cheap Branchesgit branch newbranch
    • Merge
    • Merges lump branch changes into anew unified commit
    • M da S er r ta g d n eMaster/Trunk/MainLatest a32
    • ard d n e ta g a32 Bra n chS er Master/Trunk/MainLatest d19 M 2e2 e69 8b3 erge M d19 9f1 e69
    • Merge Anythinggit merge --no-commit <sourcebranch>
    • Merge Anythinggit merge --squash <sourcebranch>
    • Merge Anythinggit merge <sourcebranch1> <sourcebranch2>
    • Rebase
    • Not a merge
    • simulates team members taking turns working (one person at a time)
    • Rebase for Claritygit checkout myfeaturebranchgit rebase master
    • RebasingMaster/Trunk/MainLatest
    • sing a32 Bra n ch eba Master/Trunk/MainLatestR 2e2 d19 8b3 e69
    • Master/Trunk/MainLatest a32 2e2 8b3 Bra ch n d19e69Rebase
    • Master/Trunk/MainLatest a32 2e2 8b3 Bra ch n
    • a32Master/Trunk/MainLatest 2e2 8b3 Bra n ch d19 e69
    • Master/Trunk/MainLatest a32 2e2 8b3e69 d19
    • Who’s Got Git?
    • UsageModels
    • CentralizedCentral Repo
    • CentralizedCentral Repo
    • Repo BlessedDictatorship
    • Repo BlessedDictatorship
    • Repo BlessedDictatorship
    • Repo BlessedDictatorship
    • Repo BlessedDictatorship
    • Certified Integration Managed Development Repo Repo
    • Certified Integration Managed Development Repo Repo
    • Certified Integration Managed Development Repo Repo
    • Certified Integration Managed Development Repo Repo
    • Private Public GitHubCustom + Public Contrib
    • Private Public GitHubCustom + Public Contrib
    • Private Public Customized GitHubCustom + Public Contrib
    • Private Public Customized GitHubCustom + Public Contrib
    • SVN Interop
    • arguably the best feature of git
    • use git in stealth mode
    • Subversiongit svn clone http://unfurl.com/trunk//Hack, hack, hackgit commit -a -m‘Some changes’git commit -a -m‘More changes’git commit -a -m‘Final changes’git svn dcommit
    • Subversion‣ First class compatibility.‣ Round trip support.‣ Git commits = svn commits.
    • effortlessly convert full historywhen ready to migrate the team
    • Migrationgit svn clone http://unfurl.com/trunk
    • MigrationYou now have a full git clone of the SVN repo
    • MigrationPower off your Subversion server
    • 3reasons
    • Cherry Pick !‣git cherry-pick a5b2ee‣Merge in just one commit.
    • Cherry Pick !‣git cherry-pick a5b2ee‣Merge in just one commit.
    • Search History "‣git grep SomeText HEAD^^^‣Search blob contents history without checkouts.
    • Search History "‣git grep SomeText HEAD^^^‣Search blob contents history without checkouts.
    • Bisect Bugs #‣git bisect run mvn test‣Binary-search for bug via failed tests.‣Manual or automated modes.‣Ant, Maven, or shell script that can return 0 or 1-127
    • Bisect Bugs #‣git bisect run mvn test‣Binary-search for bug via failed tests.‣Manual or automated modes.‣Ant, Maven, or shell script that can return 0 or 1-127
    • Twitter @matthewmccull MatthewBlog http://www.ambientideas.com/blog sidebar has all my social media linksEmail matthewm@ambientideas.comGitHub http://github.com/matthewmccullough
    • 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/