Giter VIP home page Giter VIP logo

git-svn-migrate's Introduction

ABOUT git-svn-migrate
---------------------

The git-svn-migrate project is a set of helper scripts to ease the migration of
Subversion repositories to Git.

The basic steps to converting a list of Subversion repositories into Git
repositories are the following:

1. Create a list of Subversion repositories to convert.

2. Create a list of transformations for Subversion usernames to Git committers.
   Run:
   ./fetch-svn-authors.sh  --url-file=[filename] > [output file for raw authors]

   Then edit the raw list of Subversion usernames to provide full names and
   emails suitable for Git committers.

3. Convert the Subversion repositories into bare Git repositories with:
   ./git-svn-migrate.sh --url-file=[filename] --authors-file=[filename] [destination folder]

A blog post about these migration scripts and a blog post about the underlying
techniques are available at:
http://john.albin.net/git/git-svn-migrate
http://john.albin.net/git/convert-subversion-to-git


USAGE
-----

1. Create a list of Subversion repositories to convert.

The repository list should just be a plain text file with one repository per
line. Each line can be in one of two formats. The basic format is simply the
repository's URL by itself:

  svn+ssh://example.org/svn/awesomeProject
  file:///svn/secretProject
  https://example.com/svn/evilProject

With this format the name of the project is assumed to be the last part of the
URL. So these repositories would be converted into awesomeProject.git,
secretProject.git and evilProject.git, respectively.

If the project name of your repository is not the last part of the URL, or you
wish to have more control over the final name of the Git repository, you can
specify the repository list in tab-delimited format with the first field being
the name to give the Git repository and the second field being the URL of the
Subversion repository:

  awesomeProject    svn+ssh://example.org/svn/awesomeProject/repo
  evilproject     file:///svn/evilProject
  notthedroidsyourlookingfor  https://example.com/svn/secretProject

With this format you can use any name for the final Git repo. In the first
example above, we're using the second-to-last part of the URL instead of the
last part of the URL. In the second example, we're just changing the name to all
lowercase (recommended). And in the final example, move along. Move along.

2. Create a list of transformations for Subversion usernames to Git committers.

Using the repository list created in step 1, run the fetch-svn-authors.sh script
to create a list of unique usernames for all the commits in your repositories.
The output of the script should be redirected to a file.

Example (assuming your repository list is in "repository-list.txt"):

  $ ./fetch-svn-authors.sh --url-file=repository-list.txt > author-transform.txt

Edit the raw list of Subversion usernames to provide full names and emails
suitable for Git committers. The output of the fetch-svn-authors.sh script will
be of the form:
  username = username <username>
You should edit each line to be:
  username = Full name <email>

For example:
  change:
    jwilkins = jwilkins <jwilkins>
  into:
    jwilkins = John Albin Wilkins <[email protected]>

You can run "./fetch-svn-authors.sh --help" to get full documentation on the
options it accepts.

3. Convert the Subversion repositories into bare Git repositories.

Example:

  $ ./git-svn-migrate.sh --url-file=repository-list.txt --authors-file=author-transform.txt /var/git

You can run "./git-svn-migrate.sh --help" to get full documentation on the
options it accepts.


AUTHENTICATION
--------------

Authenticating with each of the repositories is out-of-scope for these scripts.
You should ensure that all of the SVN repositories can be accessed
non-interactively (i.e. no password prompts) in order for these scripts to work.
If you consider this a bug, bugfixes are welcome!


REQUIREMENTS
------------

- git 1.7 or later
- Bash shell


LICENSE
-------

Available under the GPL v2 license. See LICENSE.txt.

git-svn-migrate's People

Contributors

deekayen avatar johnalbin avatar larsmans avatar lingo avatar mallman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-svn-migrate's Issues

Getting hung up on svn:ignore to .gitignore process

I've tried running this script a couple of times and it keeps stopping at line 205 of the git-svn-migrate.sh:

echo "- Converting svn:ignore properties into a .gitignore file..." >&2;

At least that's the last thing that get's output. The terminal just never moves passed this line. Is it possible this process just takes a long time? I see the .gitignore gets created but it never moves on as far as I can tell. It's been sitting for at least five minutes.

Problem moving trunk to master

Hi, i tried to convert a svn-repository with several branches to git, everything worked like a charm, except moving the trunk/ to master/.

~> git branch -m trunk master
fatal: A branch named 'master' already exists.

I was suprised and looked in "master/" there was a single ".gitignore" file.

Hope for help soon

Linux path

Do you really need /bin/echo ?
Without this line, you can also run it on Windows.

Greetings

add empty directories that existed in svn

This is merely a suggestion (and might be heavy-handed, but I thought I would throw it out there). When migrating from svn, empty directories do not (and technically, cannot) get added to git because git doesn't store empty directories. My suggestion is to create the folder and place a .gitignore file with the following contents:

*
!.gitignore

This would at least allow the directory to get created in the new repo, because if an empty directory is committed to svn, the developer probably expects it to exist for the application code to be in a normal state.

--help doesn't render escaped whitespace

on OSX 10.10.3 with a fresh checkout:

$ ./fetch-svn-authors.sh --help

clears the screen and displays (to start)

NAME \n\tfetch-svn-authors.sh - Retrieves Subversion usernames from a list of \n\tURLs

system info is:

$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)
Copyright (C) 2007 Free Software Foundation, Inc.
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.3
BuildVersion:   14D136

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.