Difference between revisions of "Git/migrating to git"
(.gitignore) |
(minor tweaks) |
||
Line 8: | Line 8: | ||
<li> Plan and structure your Git space | <li> Plan and structure your Git space | ||
<li> Decide what to do with your existing code | <li> Decide what to do with your existing code | ||
− | <ol> | + | <ol> |
− | + | <li> Archive your current CVS or SVN repository | |
− | <li> Archive your current CVS or SVN repository | + | <li> Import your history into git |
− | <li> Import your history into git | + | </ol> |
− | </ol> | ||
<li> Do the migration. | <li> Do the migration. | ||
− | <ol> | + | <ol> |
− | <li>Migrations must include at least the following details | + | <li>Map users |
− | <ol> | + | <li>Migrations must include at least the following details |
− | <li> Migration timeline | + | <ol> |
− | <li> mapping of current code to new Git repos | + | <li> Migration timeline |
− | <li> decision regarding existing code (archive or import) | + | <li> mapping of current code to new Git repos |
− | <li> A description for each repository (which will be visible in the web view) | + | <li> decision regarding existing code (archive or import) |
− | </ol> | + | <li> A description for each repository (which will be visible in the web view) |
− | <li>Use scripted recipes for LARGE migrations <ref>[https://github.com/maxandersen/jbosstools-gitmigration Max Anderson's recipe for migration of the JBoss Tools repos]</ref> | + | </ol> |
− | </ol> | + | <li>Use scripted recipes for LARGE migrations <ref>[https://github.com/maxandersen/jbosstools-gitmigration Max Anderson's recipe for migration of the JBoss Tools repos]</ref> |
+ | </ol> | ||
<li> Importing your SVN history into Git | <li> Importing your SVN history into Git | ||
− | <ol> | + | <ol> |
− | <li> Using svn2git on a remote server | + | <li> Using svn2git on a remote server |
− | <li> Using svn2git on build.eclipse.org | + | <li> Using svn2git on build.eclipse.org |
− | </ol> | + | </ol> |
<li> Convert svn:ignore properties to .gitignore file (example of why you need to later delete empty commits which reflect properties not code changes) | <li> Convert svn:ignore properties to .gitignore file (example of why you need to later delete empty commits which reflect properties not code changes) | ||
− | <li> | + | <li> Client and End User configurations |
− | <ol> | + | <ol> |
− | <li> | + | <li> Create keys, add each to client and server |
− | <li> Add EGit to Eclipse | + | <li> Install / setup TortoiseGit for Windows |
− | <li> [https://netbeans.org/kb/73/ide/git.html Netbeans natively supports Git] since v7.1 | + | <li> Add EGit to Eclipse |
− | </ol> | + | <li> [https://netbeans.org/kb/73/ide/git.html Netbeans natively supports Git] since v7.1 |
+ | </ol> | ||
<li> Repository permissions and group definitions, key imports | <li> Repository permissions and group definitions, key imports | ||
<li> Establish Git Resources | <li> Establish Git Resources | ||
<li> Create Git Task Force | <li> Create Git Task Force | ||
− | <li> Update references in your | + | <li> Update references in your literature, 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. |
</ol> | </ol> | ||
Revision as of 19:14, 24 September 2015
A summary of the steps for migrating your version control system to git from subversion
- Discussions with stakeholders, project lead
- 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 include the "before", the migration itself, and the "after" migration work.
- Understand the concept of Git repos
- Know the caveats
- Plan and structure your Git space
- Decide what to do with your existing code
- Archive your current CVS or SVN repository
- Import your history into git
- Do the migration.
- Map users
- Migrations must include at least the following details
- Migration timeline
- mapping of current code to new Git repos
- decision regarding existing code (archive or import)
- A description for each repository (which will be visible in the web view)
- Use scripted recipes for LARGE migrations [1]
- Importing your SVN history into Git
- Using svn2git on a remote server
- Using svn2git on build.eclipse.org
- Convert svn:ignore properties to .gitignore file (example of why you need to later delete empty commits which reflect properties not code changes)
- Client and End User configurations
- Create keys, add each to client and server
- Install / setup TortoiseGit for Windows
- Add EGit to Eclipse
- Netbeans natively supports Git since v7.1
- Repository permissions and group definitions, key imports
- Establish Git Resources
- Create Git Task Force
- Update references in your literature, 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[edit | edit source]
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. All the separate projects (from a single SVN repository) should be migrated to separate Git repositories. A tag or branch in a Git repository is always global to the repository -- so split the code into repositories along boundaries that make sense semantically. (Note that git has much better support for including library code into a project. The feature is called "sub modules". Thus library code can be semantically split out into it's own repository, and that library can be re-used across multiple git repositories. This is like svn "externals" only better.
Upside[edit | edit source]
Once you've established a git infrastructure for version control, 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.