SlideShare uma empresa Scribd logo
1 de 61
Moving to Git
Tim Moore
   tmoore
 twitter.com/
bitbucket.org/
Subversion Workflow

trunk
Subversion Workflow

     trunk
Subversion Workflow

     trunk
Subversion Workflow

     trunk




     stable
Subversion Workflow

     trunk




               1.0



             stable
Subversion Workflow

     trunk




               1.0



             stable
Subversion Workflow

     trunk




               1.0



             stable
Subversion Workflow

          trunk




            1.0



          stable
Broken Build

       trunk




         1.0



       stable
Critical Bug On Stable

            trunk




              1.0



            stable
Critical Bug On Stable

            trunk




             1.0     1.0.1



                    stable
Critical Bug On Stable

            trunk




             1.0     1.0.1



                    stable
Critical Bug On Stable

                   trunk

                     m


             1.0    1.0.1



                   stable
Merge Hell
Migration
OPTIMISE FOR
STABILITY
Get to
Get to
Get to
Get to
Convert



svn
Convert



svn    git-svn


      git-svn clone -s
Convert



svn   git-svn
Convert



svn      git-svn           git


      git push bitbucket
Mirror



svn   git-svn   git
Mirror



svn   git-svn   git
Mirror



svn   git-svn   git
Mirror



svn   git-svn   git
Mirror



svn   git-svn   git
Mirror



svn   git-svn   git
Mirror



svn   git-svn   git
Migrate Tools



svn      git-svn      git
Migrate Tools



svn      git-svn      git
Migrate Tools



svn      git-svn      git
Migrate Tools



svn      git-svn      git
Migrate Tools



svn      git-svn      git
Migrate Tools



svn      git-svn      git
Migrate Tools



svn      git-svn      git
Migrate Tools



svn      git-svn      git
Migrate People



svn      git-svn       git
Migrate People



svn      git-svn       git
Migrate People



svn      git-svn       git
Migrate People



svn      git-svn       git
Migrate People



                 git
Migrate People



     git
Git Workflow

master

  1.0
Release From Master

master

  1.0
Changes On Branches

master

  1.0




         OD-1-bug-fix
Changes On Branches

master

  1.0




         OD-1-bug-fix
Changes On Branches

master

  1.0




         OD-1-bug-fix
Changes On Branches

master

  1.0    git merge --ff-only OD-1-bug-fix




                OD-1-bug-fix
Fast-Forward Master


 1.0


           master



         OD-1-bug-fix
Git Workflow


1.0


                         master

                           1.1



           OD-1-bug-fix
Git Workflow

master

  1.0




              1



                   OD-1-bug-fix


         OD-2-feature
Git Workflow


1.0


                           master

        1                    1.1



            OD-1-bug-fix
                 2



            OD-2-feature
Git Workflow


1.0


                          master

        1                   1.1



            OD-1-bug-fix
                 2                      m

                                   OD-2-feature
Git Workflow


1.0


                          master

        1                   1.1



            OD-1-bug-fix
                 2                      m

                                   OD-2-feature
Git Workflow


1.0




        1                 1.1


                                   master
            OD-1-bug-fix
                 2                   m

                                OD-2-feature
Thanks!

Mais conteúdo relacionado

Mais procurados

Version control system & how to use git
Version control system & how to use git Version control system & how to use git
Version control system & how to use git Ahmed Dalatony
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with GitJuanma Orta
 
Pragmatic Guide to Git
Pragmatic Guide to GitPragmatic Guide to Git
Pragmatic Guide to GitConFoo
 
Enjoy privacy on Gitlab
Enjoy privacy on GitlabEnjoy privacy on Gitlab
Enjoy privacy on GitlabMaxis Kao
 
Workshop on Source control, git merge walkthroughs
Workshop on Source control, git merge walkthroughsWorkshop on Source control, git merge walkthroughs
Workshop on Source control, git merge walkthroughsDavid Lawrence
 
Git - The Incomplete Introduction
Git - The Incomplete IntroductionGit - The Incomplete Introduction
Git - The Incomplete Introductionrschwietzke
 
Git Introduction
Git IntroductionGit Introduction
Git IntroductionGareth Hall
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_gitLuis Atencio
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git BasicsSreedath N S
 
Git хуки на страже качества кода
Git хуки на страже качества кодаGit хуки на страже качества кода
Git хуки на страже качества кодаBadoo Development
 
Git 101, or, how to sanely manage your Koha customizations
Git 101, or, how to sanely manage your Koha customizationsGit 101, or, how to sanely manage your Koha customizations
Git 101, or, how to sanely manage your Koha customizationsIan Walls
 

Mais procurados (20)

Git advanced
Git advancedGit advanced
Git advanced
 
Version control system & how to use git
Version control system & how to use git Version control system & how to use git
Version control system & how to use git
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Pragmatic Guide to Git
Pragmatic Guide to GitPragmatic Guide to Git
Pragmatic Guide to Git
 
Git basics
Git basicsGit basics
Git basics
 
Enjoy privacy on Gitlab
Enjoy privacy on GitlabEnjoy privacy on Gitlab
Enjoy privacy on Gitlab
 
Workshop on Source control, git merge walkthroughs
Workshop on Source control, git merge walkthroughsWorkshop on Source control, git merge walkthroughs
Workshop on Source control, git merge walkthroughs
 
Git basics
Git basicsGit basics
Git basics
 
Git basics
Git basicsGit basics
Git basics
 
Git hooks
Git hooksGit hooks
Git hooks
 
Git - The Incomplete Introduction
Git - The Incomplete IntroductionGit - The Incomplete Introduction
Git - The Incomplete Introduction
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_git
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
 
Git
GitGit
Git
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Git хуки на страже качества кода
Git хуки на страже качества кодаGit хуки на страже качества кода
Git хуки на страже качества кода
 
沒有 GUI 的 Git
沒有 GUI 的 Git沒有 GUI 的 Git
沒有 GUI 的 Git
 
いつやるの?Git入門
いつやるの?Git入門いつやるの?Git入門
いつやるの?Git入門
 
Git 101, or, how to sanely manage your Koha customizations
Git 101, or, how to sanely manage your Koha customizationsGit 101, or, how to sanely manage your Koha customizations
Git 101, or, how to sanely manage your Koha customizations
 

Destaque

git- Most Of The Things About a Trending DVCS
git- Most Of The Things About a Trending DVCSgit- Most Of The Things About a Trending DVCS
git- Most Of The Things About a Trending DVCSIsuru Wimalasundera
 
Git, the DVCS from hell
Git, the DVCS from hellGit, the DVCS from hell
Git, the DVCS from hellRifat Nabi
 
Distributed Version Control Systems
Distributed Version Control SystemsDistributed Version Control Systems
Distributed Version Control SystemsMihail Stoynov
 
Getting Started with Git: A Primer for SVN and TFS Users
Getting Started with Git: A Primer for SVN and TFS UsersGetting Started with Git: A Primer for SVN and TFS Users
Getting Started with Git: A Primer for SVN and TFS UsersNoam Kfir
 
Svn vs mercurial vs github
Svn  vs  mercurial vs  githubSvn  vs  mercurial vs  github
Svn vs mercurial vs githubVinoth Kannan
 
Git 101 Presentation
Git 101 PresentationGit 101 Presentation
Git 101 PresentationScott Chacon
 

Destaque (8)

git- Most Of The Things About a Trending DVCS
git- Most Of The Things About a Trending DVCSgit- Most Of The Things About a Trending DVCS
git- Most Of The Things About a Trending DVCS
 
Git, the DVCS from hell
Git, the DVCS from hellGit, the DVCS from hell
Git, the DVCS from hell
 
Distributed Version Control Systems
Distributed Version Control SystemsDistributed Version Control Systems
Distributed Version Control Systems
 
Getting Started with Git: A Primer for SVN and TFS Users
Getting Started with Git: A Primer for SVN and TFS UsersGetting Started with Git: A Primer for SVN and TFS Users
Getting Started with Git: A Primer for SVN and TFS Users
 
Svn vs mercurial vs github
Svn  vs  mercurial vs  githubSvn  vs  mercurial vs  github
Svn vs mercurial vs github
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
Git 101 Presentation
Git 101 PresentationGit 101 Presentation
Git 101 Presentation
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
 

Semelhante a Moving to Git

Semelhante a Moving to Git (20)

Dive into Pinkoi 2013
Dive into Pinkoi 2013Dive into Pinkoi 2013
Dive into Pinkoi 2013
 
3 workflow
3 workflow3 workflow
3 workflow
 
Git, Jenkins & Chuck
Git, Jenkins & ChuckGit, Jenkins & Chuck
Git, Jenkins & Chuck
 
Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de Branches
 
M.Mozūras - git
M.Mozūras - gitM.Mozūras - git
M.Mozūras - git
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Git
GitGit
Git
 
Why You Should Be Using Git
Why You Should Be Using GitWhy You Should Be Using Git
Why You Should Be Using Git
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Git basics with notes
Git basics with notesGit basics with notes
Git basics with notes
 
3 Git
3 Git3 Git
3 Git
 
Git workflows (Basics)
Git workflows (Basics)Git workflows (Basics)
Git workflows (Basics)
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Git
GitGit
Git
 
Using Subversion and Git Together
Using Subversion and Git TogetherUsing Subversion and Git Together
Using Subversion and Git Together
 
Git
GitGit
Git
 
Git
GitGit
Git
 
Git workflows
Git workflowsGit workflows
Git workflows
 
With git
With gitWith git
With git
 

Moving to Git

Notas do Editor

  1. \n
  2. 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
  3. Most commits go to trunk\n
  4. Most commits go to trunk\n
  5. When we need to do a release, we would freeze trunk\nand create a stable branch to release from\n
  6. When we need to do a release, we would freeze trunk\nand create a stable branch to release from\n
  7. Update version on the stable branch\nTag it\n
  8. Unfreeze trunk\n
  9. Keep committing there\nThis is good for the ideal situation: everything on trunk is good, stable doesn’t need to change\n
  10. 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
  11. What about a bug on stable?\n
  12. You have to fix it on stable\n
  13. Bump the version, tag and release\n
  14. 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
  15. 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
  16. \n
  17. 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
  18. \n
  19. \n
  20. \n
  21. \n
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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
  29. Post-commit hook in Subversion\nCron job on a machine hosting the conversion repo\nCI server\n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. 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
  44. All at once\nTry to get everyone committed, otherwise need to use patches\nCode freeze svn\nClone remote git repo\nYou’re off!\n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. 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
  52. \n
  53. We release from master directly\nMaster is the stable branch\n
  54. We put changes on a branch\nIssue key (for traceability)\nTextual description (for readability)\nProtip: use git bash completion\n
  55. We do reviews and QA on the branch\n
  56. When the branch is ready to release, we do a fast-forward merge to master\n
  57. Fast-forwarding ensures no untested commits hit master\n
  58. \n
  59. Simultaneous features are on separate branches\n
  60. Can keep committing to topic branches while master is merged and released\n
  61. New commits on master are merged to active topic branches\n
  62. Merge commits are tested on the branch\n
  63. 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
  64. \n