Search code examples
gitsvngithubversion-controlgit-svn

Push files from svn to git server


I'm new to stack overflow, so if I do something wrong just tell me. I've been looking for an answer for 3 hours and still nothing have worked for me, so I think it's time to ask. I need to checkout my svn repo and then push it to git server... However I have no idea how to do it. For now I've used git-svn to get the repo:

git svn clone mysecreturl -T trunk -b branches -t tags B

B is the folder I wanted copied repo to be in. Then I added B to git:

git add B
git commit -m "Added svn repo"
git push origin master

However I can't add the files from that directory to git server and they haven't been added recursively... Also when I try:

git add B/*

I get an error message fatal: Pathspec 'B/main.c' is in submodule 'B'.


Solution

  • After the success of the git svn clone you will have a new, fully fledged git repository in your folder B. You will probably not want it to be located inside another git repository. Instead you could push directly from B:

    cd B
    git remote add origin <your git server>
    git push origin --all