Open main menu

Git/migrating to git

< Git
Revision as of 14:22, 24 September 2015 by Freephile (talk | contribs) (Modified version of the outline at https://wiki.eclipse.org/Git/Migrating_to_Git)

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)

A summary of the steps for migrating your version control system to git from subversion

  1. Discussions with stakeholders, project lead
  2. Leverage the resources and expertise of prior large migrations including Pro Git 2nd Ed. Eclipse Foundation, Atlassian, Wikimedia Foundation, EclipseCon proposed talk by Max Anderson, Drupal, PostgreSQL, and Pentaho. Be sure to plan for the "before", the actual migration, and the "after" migration work.
  3. Understand the concept of Git repos
  4. Know the caveats
  5. Plan and structure your Git space
  6. Decide what to do with your existing code
    1. Archive your current CVS or SVN repository
    2. Import your history into git
  7. Do the migration.
    1. Migrations must include at least the following details
      1. Migration timeline
      2. mapping of current code to new Git repos
      3. decision regarding existing code (archive or import)
      4. A description for each repository (which will be visible in the web view)
    2. Use/learn from recipes for LARGE migrations [1]
  8. Importing your SVN history into Git
    1. Using svn2git on a remote server
    2. Using svn2git on build.eclipse.org
  9. Convert .svnignore to .gitignore
  10. Git Team Provider for Eclipse / Developer Tools setup / Client and End User configurations
    1. Add EGit to Eclipse
    2. Netbeans natively supports Git since v7.1
  11. Git Resources
  12. Git Task Force
  13. Update references in your product brochures, project documents, websites, systems, reference materials and procedure documents to reference the new systems. This step can be ameliorated if in the beginning you reference code in a generic way such as "code.example.com" where you can then link to various aspects and implementations of your code systems; rather than naming them specifically based on technology or implementation.

Caveats

A single Subversion repository almost always contains multiple "projects" - each with it's own 'trunk', 'branches' and 'tags'. One thing you'll find moving from SVN to Git is that Git repositories aren't designed for multiple projects in the way that SVN is used. Separate projects in a single SVN repository should be moved to different Git repositories. So you'll want to split up a multi-project SVN repo when moving to Git. A tag or branch in a Git repository is always global to the repository -- so a good rule of thumb is "what makes semantic sense as a single version".

Benefits

git to git migrations are incredibly easy... at least for the core git repository functions. Just add another remote to push/pull. This means that if you wish to change your git infrastructure to use a different system, the work involved will mostly be about the extra features bundled with the system (e.g. web viewer, code review, etc.) and integrations.


References