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

"You've decided to Use Git as Your VCS for Your Team...So Now What?

"You've decided to Use Git as Your VCS for Your Team...So Now What?

Slides from the presentation I gave at the php|arch Git Summit

Chris Hartjes

February 01, 2012
Tweet

More Decks by Chris Hartjes

Other Decks in Programming

Transcript

  1. “You’ve decided to Use
    Git as Your VCS for
    Your Team...So Now
    What?”
    Chris Hartjes -- Moontoast

    View Slide

  2. $progStartYear = 1982;
    $firstComputer = ‘VIC-20’;
    $phpStartYear = 1998;

    View Slide

  3. High-traffic online dating
    Sports data integration
    Social commerce platform

    View Slide

  4. View Slide

  5. View Slide

  6. News feed
    • at a glance see who’s been doing things
    • see exactly what’s been done

    View Slide

  7. Access control
    • makes it easy to add outside contributors
    via public keys
    • control who has access to specific repos

    View Slide

  8. Web-based viewing
    • CLI sucks for looking at code changes
    • Tweaking of web UI always working
    towards smoother experience

    View Slide

  9. View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. View Slide

  14. • master
    • stage
    • uatX
    • feature branches
    • hotfix branches

    View Slide

  15. Contains only
    code in production
    master branch

    View Slide

  16. stage branch

    View Slide

  17. uatX branches

    View Slide

  18. feature
    branches

    View Slide

  19. [email protected] [~/pi]
    -> % git checkout -b feature-git-summit
    Switched to a new branch 'feature-git-summit'
    [email protected] [~/pi]
    -> %
    * choose consistent naming scheme
    * Moontoast uses project milestone name
    * ALWAYS create off of master branch

    View Slide

  20. hotfix branches

    View Slide

  21. [email protected] [~/pi]
    -> % git checkout master
    Switched to branch 'master'
    [email protected] [~/pi]
    -> % git checkout -b hotfix-1234-git-summit
    Switched to a new branch 'hotfix-1234-git-summit'
    [email protected] [~/pi]
    -> %
    * always named after ticket number
    * ALWAYS create off of master branch

    View Slide

  22. View Slide

  23. Merging branches
    [email protected] [~/pi]
    -> % git checkout feature-git-summit
    Switched to branch 'feature-git-summit'
    [email protected] [~/pi]
    -> % git merge --no-ff master

    View Slide

  24. Care and feeding
    for your branches

    View Slide

  25. • long-running feature branches increase risk
    of nasty conflicts
    • best practice is to merge master INTO
    feature branches EVERY time a production
    push occurs

    View Slide

  26. Integration with deployment tools

    View Slide

  27. View Slide

  28. Whiskey Disk
    • https://github.com/flogic/whiskey_disk
    • “Embarrassingly fast deployments”

    View Slide

  29. • updates code-in-place via ‘git pull’
    • runs shell scripts to perform other duties
    • encourages practice of separate repo for
    configuration files for your application
    Whiskey Disk

    View Slide

  30. Other Git aware tools
    • Capistrano (Ruby but not Ruby only)
    • Jenkins (CI server)
    • Deployinator (open sourced by Etsy)

    View Slide

  31. How did
    Moontoast
    do it again?

    View Slide

  32. Used GitHub
    • self-hosting Git repos requires resources
    • management tools make a huge difference
    • GitHub API allows for innovative solutions

    View Slide

  33. Branch-and-Merge
    • allows for parallel development
    • branching is a “cheap” behaviour
    • be careful with long-running branches
    • DON’T CROSS THE STREAMS

    View Slide

  34. Git-aware deployments
    • Most modern tools support Git
    • GitHub API FTW (IRC bot that deploys?)

    View Slide

  35. Thank you!
    • @grmpyprogrammer
    • http://www.littlehart.net/atthekeyboard

    View Slide