$30 off During Our Annual Pro Sale. View Details »

"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
  2. $progStartYear = 1982; $firstComputer = ‘VIC-20’; $phpStartYear = 1998;

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

  4. None
  5. None
  6. News feed • at a glance see who’s been doing

    things • see exactly what’s been done
  7. Access control • makes it easy to add outside contributors

    via public keys • control who has access to specific repos
  8. Web-based viewing • CLI sucks for looking at code changes

    • Tweaking of web UI always working towards smoother experience
  9. None
  10. None
  11. None
  12. None
  13. None
  14. • master • stage • uatX • feature branches •

    hotfix branches
  15. Contains only code in production master branch

  16. stage branch

  17. uatX branches

  18. feature branches

  19. chartjes@marmalade [~/pi] -> % git checkout -b feature-git-summit Switched to

    a new branch 'feature-git-summit' chartjes@marmalade [~/pi] -> % * choose consistent naming scheme * Moontoast uses project milestone name * ALWAYS create off of master branch
  20. hotfix branches

  21. chartjes@marmalade [~/pi] -> % git checkout master Switched to branch

    'master' chartjes@marmalade [~/pi] -> % git checkout -b hotfix-1234-git-summit Switched to a new branch 'hotfix-1234-git-summit' chartjes@marmalade [~/pi] -> % * always named after ticket number * ALWAYS create off of master branch
  22. None
  23. Merging branches chartjes@marmalade [~/pi] -> % git checkout feature-git-summit Switched

    to branch 'feature-git-summit' chartjes@marmalade [~/pi] -> % git merge --no-ff master
  24. Care and feeding for your branches

  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
  26. Integration with deployment tools

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

  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
  30. Other Git aware tools • Capistrano (Ruby but not Ruby

    only) • Jenkins (CI server) • Deployinator (open sourced by Etsy)
  31. How did Moontoast do it again?

  32. Used GitHub • self-hosting Git repos requires resources • management

    tools make a huge difference • GitHub API allows for innovative solutions
  33. Branch-and-Merge • allows for parallel development • branching is a

    “cheap” behaviour • be careful with long-running branches • DON’T CROSS THE STREAMS
  34. Git-aware deployments • Most modern tools support Git • GitHub

    API FTW (IRC bot that deploys?)
  35. Thank you! • @grmpyprogrammer • http://www.littlehart.net/atthekeyboard