Search code examples
gitgithubsvnclone

How to clone local svn work directory to git repo and upload to github?


The task is to migrate from local svn work directory to git repository and upload to remote github.

System: Windows 10 64 bit

git-svn version: 2.21.0.windows.1 (svn 1.9.7)

1- I installed TortoiseGit and try to apply git clone command and provide the origin to point to the github url using

username:[email protected]/repo.git

I got this error: "Using existing [svn-remote "svn"] svn-remote.svn.fetch already set to track :refs/remotes/git-svn"

2- Using GitBatch I run:

svn log -q svnurl | grep '^r[0-9]' | awk '{print $3}' | sort | uniq > authors.txt

I got the authors.txt correctly then I run:

git config --global --unset http.proxy 

and

git svn clone file:///C/Users/Documents/GitHub/Repo --authors-file=C://authors.txt C://Users//Documents/GitHub/Repo_Git

I got the same error: git-svn windows Using existing [svn-remote "svn"] svn-remote.svn.fetch already set to track :refs/remotes/git-svn

Till now I couldn't clone local svn to git and then to upload to github, please help

I read git-svn documentation and read svn2git tool guide but don't help!

Thanks in advance, Mariam


Solution

  • git-svn is better suited if you're going to push/pull commits between git and svn. For a straight export, svn2git is a much better solution and way faster.
    https://github.com/svn-all-fast-export/svn2git