PHPackages                             phillipsdata/git-migrate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phillipsdata/git-migrate

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phillipsdata/git-migrate
========================

SVN to Git Migrator

1.2.0(10y ago)0251[1 issues](https://github.com/phillipsdata/git-migrate/issues)MITPHPPHP &gt;=5.4.0

Since Aug 25Pushed 10y ago4 watchersCompare

[ Source](https://github.com/phillipsdata/git-migrate)[ Packagist](https://packagist.org/packages/phillipsdata/git-migrate)[ RSS](/packages/phillipsdata-git-migrate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Git Migrate
===========

[](#git-migrate)

[![Build Status](https://camo.githubusercontent.com/12e5582218683b5197f92721fef4a49293fc016f7e3453db6030a4b9ce8874dd/68747470733a2f2f7472617669732d63692e6f72672f7068696c6c697073646174612f6769742d6d6967726174652e737667)](https://travis-ci.org/phillipsdata/git-migrate) [![Coverage Status](https://camo.githubusercontent.com/872ac85238687e91aa4a231046d504dcadde5cbc1e4d27d530d005f2dee21bf3/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7068696c6c697073646174612f6769742d6d6967726174652f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/phillipsdata/git-migrate?branch=master)

A utility for migrating from SVN to Git.

Uses [Atlassian's svn-migration-scripts](https://bitbucket.org/atlassian/svn-migration-scripts/downloads)to migrate various SVN repositories to Git. This utility is particularly useful when you have many externals grouped under a single SVN URL.

How it Works
------------

[](#how-it-works)

1. GitMigrate will execute `git` on your machine to clone an SVN repository to a local path. **Note**: Your repositories **MUST** be in standard SVN format (/trunk, /branches, /tags).
2. GitMigrate will then execute the svn-migration-scripts to place tags in their correct location.

Usage
-----

[](#usage)

### 0. Install git on your machine

[](#0-install-git-on-your-machine)

If you don't already have git installed, [install it](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). Then make sure it can be executed via `git`.

You'll also need to ensure you have a somewhat modern version of java as well.

### 1. Install via composer

[](#1-install-via-composer)

```
composer require phillipsdata/git-migrate
```

### 2. Create your config

[](#2-create-your-config)

The config is a JSON file that represents the repositories that you wish to operate on, as well as any other options that are available as parameters to the `git-migrate` utility.

It looks like this:

```
{
  "repositories": [
    {
      "path": "my-external-dir/another-dir/repo1",
      "origin": "https://domain.com/repo1.git"
    },
    {
      "path": "my-external-dir/another-dir/repo2"
    }
  ],
  "authors": "/path/to/authors.txt",
  "dir": "/path/to/",
  "javalib": "/path/to/svn-migration-scripts.jar",
  "url": "svn://svn.yourdomain.com/"
}
```

Each repository's **path** is a URI of the **url** option specified.

Notice how our repo2 has no origin. The **origin** is optional for all repositories. Setting an origin allows us to `push` the repository to that remote repository using the `--push` flag.

See the **Options** section for an explanation of the various other options.

#### Items File (deprecated)

[](#items-file-deprecated)

The items config is a file that returns the directory structure of individual repositories. If you're simply migrating a single repository that might look like:

```
