Moving to Git

771 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
771
On SlideShare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • Our Subversion workflow: how it worked and why we wanted to switch\nOur migration process: how we made the switch to Git without disruption\nOur Git workflow: what we changed and why it's better now\n
  • Most commits go to trunk\n
  • Most commits go to trunk\n
  • When we need to do a release, we would freeze trunk\nand create a stable branch to release from\n
  • When we need to do a release, we would freeze trunk\nand create a stable branch to release from\n
  • Update version on the stable branch\nTag it\n
  • Unfreeze trunk\n
  • Keep committing there\nThis is good for the ideal situation: everything on trunk is good, stable doesn’t need to change\n
  • Now nobody can commit at all\nCan’t release until it’s fixed\n\nWe tried topic branches to reduce risk on trunk, but ran into frequent conflicts\nMerge hell\n
  • What about a bug on stable?\n
  • You have to fix it on stable\n
  • Bump the version, tag and release\n
  • Merge to trunk\nPray there are no conflicts\nIf the intervening commit changed something on trunk that changed on the branch, you’re in merge hell\nThe merge doesn’t explicitly track the second parent\nIf you need to merge again from the branch, you’re in merge hell\n
  • Subversion handles conflicts more poorly than DVCS tools\nThis svn development workflow increases mistakes\nWe’ve had dependencies go backwards\nTree conflicts\nSemantic conflicts: think about tests\nConflicts are often resolved on trunk\nSometimes you forget to merge changes on branches\nSubversion doesn’t visualise branches well\nSubversion doesn’t track merges well\nSome clients don’t work with merge tracking—bolted on\n\nWe needed to escape\nWanted to move to a workflow where risky changes are isolated\nWithout risking constant merge hell\n
  • \n
  • Get to know git first\nMinimize time that devs can’t commit\nKeep builds running\nKeep code reviews\nEnsure you can always release\nDon’t change process at the same time—wait until after you migrate\nLeave time/flexibility in your plan to deal with unforeseen issues\n
  • \n
  • \n
  • \n
  • \n
  • Migration Algorithm: similar to blue-green deploy model, or database replication\nConvert svn repo to git\nMirror svn to git as a read-only copy\nMigrate tools first (readers)\nMigrate people last (writers)\nLook at the converted repo, make sure it makes sense\nClean up tags\nNo hierarchical branches\nConsider trimming\nPrivate branches\nLarge objects in single branches\nConsider archive repo\nNever commit/push directly to this: use for mirroring only\nConsider periodically pushing this repo to a separate remote repo\n
  • Migration Algorithm: similar to blue-green deploy model, or database replication\nConvert svn repo to git\nMirror svn to git as a read-only copy\nMigrate tools first (readers)\nMigrate people last (writers)\nLook at the converted repo, make sure it makes sense\nClean up tags\nNo hierarchical branches\nConsider trimming\nPrivate branches\nLarge objects in single branches\nConsider archive repo\nNever commit/push directly to this: use for mirroring only\nConsider periodically pushing this repo to a separate remote repo\n
  • Migration Algorithm: similar to blue-green deploy model, or database replication\nConvert svn repo to git\nMirror svn to git as a read-only copy\nMigrate tools first (readers)\nMigrate people last (writers)\nLook at the converted repo, make sure it makes sense\nClean up tags\nNo hierarchical branches\nConsider trimming\nPrivate branches\nLarge objects in single branches\nConsider archive repo\nNever commit/push directly to this: use for mirroring only\nConsider periodically pushing this repo to a separate remote repo\n
  • Migration Algorithm: similar to blue-green deploy model, or database replication\nConvert svn repo to git\nMirror svn to git as a read-only copy\nMigrate tools first (readers)\nMigrate people last (writers)\nLook at the converted repo, make sure it makes sense\nClean up tags\nNo hierarchical branches\nConsider trimming\nPrivate branches\nLarge objects in single branches\nConsider archive repo\nNever commit/push directly to this: use for mirroring only\nConsider periodically pushing this repo to a separate remote repo\n
  • Migration Algorithm: similar to blue-green deploy model, or database replication\nConvert svn repo to git\nMirror svn to git as a read-only copy\nMigrate tools first (readers)\nMigrate people last (writers)\nLook at the converted repo, make sure it makes sense\nClean up tags\nNo hierarchical branches\nConsider trimming\nPrivate branches\nLarge objects in single branches\nConsider archive repo\nNever commit/push directly to this: use for mirroring only\nConsider periodically pushing this repo to a separate remote repo\n
  • Migration Algorithm: similar to blue-green deploy model, or database replication\nConvert svn repo to git\nMirror svn to git as a read-only copy\nMigrate tools first (readers)\nMigrate people last (writers)\nLook at the converted repo, make sure it makes sense\nClean up tags\nNo hierarchical branches\nConsider trimming\nPrivate branches\nLarge objects in single branches\nConsider archive repo\nNever commit/push directly to this: use for mirroring only\nConsider periodically pushing this repo to a separate remote repo\n
  • Migration Algorithm: similar to blue-green deploy model, or database replication\nConvert svn repo to git\nMirror svn to git as a read-only copy\nMigrate tools first (readers)\nMigrate people last (writers)\nLook at the converted repo, make sure it makes sense\nClean up tags\nNo hierarchical branches\nConsider trimming\nPrivate branches\nLarge objects in single branches\nConsider archive repo\nNever commit/push directly to this: use for mirroring only\nConsider periodically pushing this repo to a separate remote repo\n
  • Post-commit hook in Subversion\nCron job on a machine hosting the conversion repo\nCI server\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Move tools one at a time\nStart with a separate CI plan\nMake sure its behaviour matches the normal one\nHow to decide when to pass here?\nMove normal one when you’re confident\nYou might want to hold off on automated release builds until later, but test them now\nCode review/source browsing/searching\nDashboards\n
  • All at once\nTry to get everyone committed, otherwise need to use patches\nCode freeze svn\nClone remote git repo\nYou’re off!\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Consider leaving the original svn repo running, read-only to avoid breaking links\nOnly change process after you're comfortable with the new tools\n
  • \n
  • We release from master directly\nMaster is the stable branch\n
  • We put changes on a branch\nIssue key (for traceability)\nTextual description (for readability)\nProtip: use git bash completion\n
  • We do reviews and QA on the branch\n
  • When the branch is ready to release, we do a fast-forward merge to master\n
  • Fast-forwarding ensures no untested commits hit master\n
  • \n
  • Simultaneous features are on separate branches\n
  • Can keep committing to topic branches while master is merged and released\n
  • New commits on master are merged to active topic branches\n
  • Merge commits are tested on the branch\n
  • Fast-forward master when it’s ready to release\n\nmaster is always stable & releasable\nchanges & merges are always tested before hitting master\nbalances continuous integration with scalability & safety\n
  • \n
  • Moving to Git

    1. 1. Moving to Git
    2. 2. Tim Moore tmoore twitter.com/bitbucket.org/
    3. 3. Subversion Workflowtrunk
    4. 4. Subversion Workflow trunk
    5. 5. Subversion Workflow trunk
    6. 6. Subversion Workflow trunk stable
    7. 7. Subversion Workflow trunk 1.0 stable
    8. 8. Subversion Workflow trunk 1.0 stable
    9. 9. Subversion Workflow trunk 1.0 stable
    10. 10. Subversion Workflow trunk 1.0 stable
    11. 11. Broken Build trunk 1.0 stable
    12. 12. Critical Bug On Stable trunk 1.0 stable
    13. 13. Critical Bug On Stable trunk 1.0 1.0.1 stable
    14. 14. Critical Bug On Stable trunk 1.0 1.0.1 stable
    15. 15. Critical Bug On Stable trunk m 1.0 1.0.1 stable
    16. 16. Merge Hell
    17. 17. Migration
    18. 18. OPTIMISE FORSTABILITY
    19. 19. Get to
    20. 20. Get to
    21. 21. Get to
    22. 22. Get to
    23. 23. Convertsvn
    24. 24. Convertsvn git-svn git-svn clone -s
    25. 25. Convertsvn git-svn
    26. 26. Convertsvn git-svn git git push bitbucket
    27. 27. Mirrorsvn git-svn git
    28. 28. Mirrorsvn git-svn git
    29. 29. Mirrorsvn git-svn git
    30. 30. Mirrorsvn git-svn git
    31. 31. Mirrorsvn git-svn git
    32. 32. Mirrorsvn git-svn git
    33. 33. Mirrorsvn git-svn git
    34. 34. Migrate Toolssvn git-svn git
    35. 35. Migrate Toolssvn git-svn git
    36. 36. Migrate Toolssvn git-svn git
    37. 37. Migrate Toolssvn git-svn git
    38. 38. Migrate Toolssvn git-svn git
    39. 39. Migrate Toolssvn git-svn git
    40. 40. Migrate Toolssvn git-svn git
    41. 41. Migrate Toolssvn git-svn git
    42. 42. Migrate Peoplesvn git-svn git
    43. 43. Migrate Peoplesvn git-svn git
    44. 44. Migrate Peoplesvn git-svn git
    45. 45. Migrate Peoplesvn git-svn git
    46. 46. Migrate People git
    47. 47. Migrate People git
    48. 48. Git Workflowmaster 1.0
    49. 49. Release From Mastermaster 1.0
    50. 50. Changes On Branchesmaster 1.0 OD-1-bug-fix
    51. 51. Changes On Branchesmaster 1.0 OD-1-bug-fix
    52. 52. Changes On Branchesmaster 1.0 OD-1-bug-fix
    53. 53. Changes On Branchesmaster 1.0 git merge --ff-only OD-1-bug-fix OD-1-bug-fix
    54. 54. Fast-Forward Master 1.0 master OD-1-bug-fix
    55. 55. Git Workflow1.0 master 1.1 OD-1-bug-fix
    56. 56. Git Workflowmaster 1.0 1 OD-1-bug-fix OD-2-feature
    57. 57. Git Workflow1.0 master 1 1.1 OD-1-bug-fix 2 OD-2-feature
    58. 58. Git Workflow1.0 master 1 1.1 OD-1-bug-fix 2 m OD-2-feature
    59. 59. Git Workflow1.0 master 1 1.1 OD-1-bug-fix 2 m OD-2-feature
    60. 60. Git Workflow1.0 1 1.1 master OD-1-bug-fix 2 m OD-2-feature
    61. 61. Thanks!

    ×