Skip to content

Instantly share code, notes, and snippets.

@dharma017
Last active September 13, 2015 11:59
Show Gist options
  • Select an option

  • Save dharma017/a4bf729b1e598fb78201 to your computer and use it in GitHub Desktop.

Select an option

Save dharma017/a4bf729b1e598fb78201 to your computer and use it in GitHub Desktop.
Migrate SVN to GIT

Recursively Delete .svn Directories

An awesome command line script which recursively removes .svn directories from parent directories.

find . -type d -name .svn -exec rm -rf {} \;

The script starts within the current directory, so be sure you navigate to the directory you want to start searching from first.

It is basically just 1 command to clone the svn repos to your local working directory. The operation will maintain the logs.

git svn clone -s http://my.svnserver.com/svn/myapp/ MyAppGit

The -s command will clone just the trunk. If you don’t use the stand trunk, tag, branch, you can -s and it will clone the whole repos.

You can verify all logs are there with git log. Next, maintain the same ignore configurations.

git svn create-ignore

Lastly, add the new remote to your git repos (eg Github).

git remote add origin https://github.com/relizont/myapp.git
git push -u origin master

Example:

git svn clone -s https://192.168.1.3/svn/Carlsoo-JamboTours jambotours

That’s all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment