Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git for Windows

Git for Windows

Not sure if Git is for you and whether it plays nice on Windows? We will demystify the internals and operations flow while covering Windows specific integration. Free options like Git Extensions, TortoiseGit, Command Line, GitHub for Windows and Visual Studio Tools for Git are in as well.

Not lucky to have Git as reference repository? You're still in luck. Projects like git-tfs, git-tf and git-svn allow you to work with TFS and Subversion repositories as if they were Git repositories.

Ovidiu Dimulescu

March 16, 2013
Tweet

More Decks by Ovidiu Dimulescu

Other Decks in Technology

Transcript

  1. Git for Windows
    Orlando Code Camp, 2013
    Ovidiu Dimulescu
    @odimulescu
    speakerdeck.com/odimulescu

    View full-size slide

  2. • SCMs Evolution
    • Benefits
    • Storage Model
    • Repositories Layout
    • Operations Flow
    • Setup
    • Questions?
    Agenda

    View full-size slide

  3. About @odimulescu
    • Working on the Web since 1997

    • Organizer for JaxMUG.com
    • Co-Organizer for Jax Big Data meetup

    View full-size slide

  4. 1st Generation - RCS, SCCS
    • Single file-based operations
    • Local only
    2nd Generation – CVS, SVN, TFS
    • Multi-file based operations
    • Centralized client / server architecture
    • Merge before commit
    3rd Generation – Git, Hg, Bzr, Arch
    • Multi-file based operations
    • Decentralized / Distributed architecture
    • Commit before merge
    SCMs Evolution

    View full-size slide

  5. • Tendency towards more concurrency
    • DVCS get most of the buzz and innovation
    Open Source: Git, Mercurial
    Commercial: Kiln, Veracity, PlasticSCM
    • 2nd Gen VCS advances are slowing down
    Last SVN major release took 2 years
    Trends

    View full-size slide

  6. • Actively developed ecosystem
    • Ton of free good docs
    • Cool kids are doing it:
    • Hosted repos:
    • Cross-platform:
    • Deployment tool:
    • Marketable skill
    Git Benefits - By Marketplace

    View full-size slide

  7. • Fast (logs, diffs, etc.)
    • Facilitates experimentation
    – Fast branch creation and switching
    – Easy merge and re-merge
    – Stashing Commit before merge
    • Code artist, driver seat
    • Multitasking
    Git Benefits - For Developers

    View full-size slide

  8. • Large binaries that change often: games, CAD, etc.
    – git-annex
    – git-media
    • Security concerns, entire repository is stored locally
    • Extremely large projects, a full local copy is not feasible
    – shallow clones
    – sparse checkouts
    – submodules
    – subtree
    ?

    View full-size slide

  9. Storage Model

    View full-size slide

  10. Git
    Other
    Storage Model - Versioning

    View full-size slide

  11. • Each file revision is stored as a unique BLOB object. The
    object identifier is an SHA-1 hash of its content.
    • Git is content-addressable file-system that has a
    notion of versions
    • Versions are snapshots of the entire tree
    • Object database: BLOBs, TREEs, COMMITs, TAGs
    Storage Model - Internals

    View full-size slide

  12. • Everyone has direct commit access
    • Uses a familiar paradigm
    • Minimal overhead and bottlenecks
    • Works well for most teams
    Repositories Layout - Centralized

    View full-size slide

  13. 1. Project maintainer is sole committer to the reference repository
    2. Contributors clone (fork) that repository and makes changes
    3. Contributor commits those changes to their own public copy
    4. Contributor asks the projects maintainer to apply changes
    5. Project maintainer reviews, merges & commits to ref. repository
    Repositories Layout - Hierarchical

    View full-size slide

  14. Operations Flow - Local

    View full-size slide

  15. Operations Flow - Merging
    $ git merge origin

    View full-size slide

  16. $ git rebase origin
    Operations Flow - Rebasing

    View full-size slide

  17. $ git cherry-pick C3
    Operations Flow - Cherry-picking

    View full-size slide

  18. Windows Setup

    View full-size slide

  19. Hierarchical
    System wide
    Per User
    Per Project
    Common Settings
    • Identity - Name + Email
    • Ignored files
    • End of line settings
    Configuration Basics

    View full-size slide

  20. Configuration Basics - EOL
    * Images Credit: http://blog.subgit.com/tag/autocrlf/
    Since 1.7.2 - Attributes
    text - on / off
    eol - how
    Pre 1.7.2 - core.autocrlf
    true
    false
    input

    View full-size slide

  21. Official client - git-scm.com
    GitHub for Windows - windows.github.com
    Tortoise Git - code.google.com/p/tortoisegit
    Git Extensions - code.google.com/p/gitextensions
    EGit for Eclipse - www.eclipse.org/egit
    Visual Studio Tools for Git - bit.ly/VvYiak *
    SourceTree - www.sourcetreeapp.com *
    Clients - Gratis

    View full-size slide

  22. SmartGit - http://www.syntevo.com/smartgit/index.html
    Clients - Have you ?

    View full-size slide

  23. Git <-> Svn - Built-in
    Git <-> TFS - www.git-tfs.com, 3rd Party, Win only
    Git <-> TF - gittf.codeplex.com, MS, Java based
    Git <-> Hg - hg-git.github.com
    Git <-> Perforce - Built-in
    Bridges to other VCSes

    View full-size slide

  24. Clients - Side by Side
    Official Git
    CLI, Git-GUI, Gitk
    Built-in bridges: svn, perforce
    WinExplorer integration (git-cheetah)
    Aliases support
    UI tools limited
    Github for Windows
    Easy integration with GitHub
    All in one installer (Git, Posh-Git)
    “Clone in Windows” browser button
    Dumbed down functionality
    Git Extensions
    All in one installer (Git, KDiff3)
    Visual Studio integration, 2005 - 2012
    WinExplorer integration
    Staging support
    TortoiseGit
    Good interface
    WinExplorer integration
    Hides Git operations

    View full-size slide

  25. Visual Studio Tools for Git - bit.ly/vstools4git
    2012 Update 2 (CTP)
    SourceTree - www.sourcetreeapp.com
    Mac only
    Windows Private Beta
    Clients - Exciting*

    View full-size slide

  26. • Uber fast, full history & versioning locally
    • Commit before merge is liberating
    • Multi-platform, enables different workflows
    • Well documented and integrated
    • Marketable skill
    Summary

    View full-size slide

  27. Visual Studio Tools for Git, MSDN
    Git Extensions, Henk Westhuis
    Git-TF, CodePlex
    Git Presentations, Steve Chacon
    Pro Git Book, Steve Chacon
    Pragmatic Guide to Git, Travis Swicegood
    References

    View full-size slide

  28. Official Documentation
    ProGit.org
    GitMagic
    GitReady.com
    GitRef.org
    Version Control by Example
    Visual Git Reference
    Try Git
    Resources

    View full-size slide

  29. Questions ?
    Ovidiu Dimulescu
    @odimulescu
    speakerdeck.com/odimulescu

    View full-size slide