Open ensonic opened 12 years ago
Okay, it seem that one needs to convert the whole repository and then use git filter-branch remove subprojects. That is if one has: trunk/ project1/ project2/
one cannot run svn2git using http://server.com/trunk/project1, but instead need to run it using http://server.com for each project and then filter:
git filter-branch --subdirectory-filter
Now I still need to figure how to fixup the messed up tags.
Hey @ensonic, I was getting the same error you reported. Here's what I did to get just what I wanted out of svn2git for a single nested subproject:
To export project 'x' in a repo at http://example.org/svn, where 'x' is a nested project with structure ./x/trunk ./x/branches and ./x/tags, and where the first revision in which 'x' appears in the repository is r153, I did:
svn2git http://example.org/svn --verbose --revision 153 --trunk x/trunk --branches x/branches --tags x/tags
and it seems to have figured everything out nicely for project 'x'. Basically, I just pushed the project name (x) onto the --trunk, --branches, and --tags paths and it worked out alright.
Thanks for your comment on this issue, it got me started on the right train of thought!
In my case I got the error above due to an issue somewhere in the .git directory. I deleted the .git directory and re-ran svn2git and things started working.
svn2git http://svn.quantsoftware.org/openquantsoftware/trunk --verbose Running command: git svn init --prefix=svn/ --no-metadata --trunk=trunk --tags=tags --branches=branches http://svn.quantsoftware.org/openquantsoftware/trunk Initialized empty Git repository in /Users/nilesh/projects/test/.git/ Using higher level of URL: http://svn.quantsoftware.org/openquantsoftware/trunk => http://svn.quantsoftware.org/openquantsoftware Running command: git svn fetch Running command: git branch -l --no-color Running command: git branch -r --no-color Running command: git config --local --get user.name Running command: git config --local --get user.email Running command: git checkout -f master error: pathspec 'master' did not match any file(s) known to git. command failed: 2>&1 git checkout -f master
I second @technicalreality. Removing .git fixed my problem.
I'm getting the same issue. I've removed the .git folder but still the same error message. Any other thoughts?
FYI, it is with one of our original projects in SVN from quite a while ago. I see that the containing folder immediately below trunk was renamed. Originally www it is now webcontent. Could the renaming be affecting it?
Thanks for the tip, @technicalreality. It's work for me like a charm.
Also I've an issue with svn2git similar to @tforster 's one. In my case the clue was to understand that trunk folder has the name of the project itself, so the option "--rootistrunk" was my choice. Hope this'll help.
@technicalreality Thanks for that tip. Deleted .git
folder and re-run svn2git
, all is good now. Though I wonder why this tip works.
thanks to @andrewfhart and @technicalreality and @btjones from https://github.com/nirvdrum/svn2git/issues/59)
I wanted to convert a heavily nested SVN repo to individual git repo's. eg https://server.com/svn/inteomics/Mark/R/excelIO/ where each project had to traditional structure: {trunk,branches,tags}
I needed to do 3 things: 1) use a fresh folder -- ie no .git 2) enable -v and enter my password every time the 'Authentication realm: https://server:443 Subversion Repositories' message popped up (>5 times). 3) explicitly specify --trunk, --branches and --tags as below:
svn2git https://server.com/svn/inteomics --username marcow -v --trunk Mark/R/excelIO/trunk --branches Mark/R/excelIO/branches --tags Mark/R/excelIO/tags
Instead of hijacking ticket #23, I'll try as a new one as it might be a different issue. See the log below:
I am getting a bit desperate and wonder what else I could try to shed light on this issue. Should't "git branch -l" show something already. Maybe you could add some sanity checks after each step and error out earlier. I have the feeling that the error in the description just means "sonmething failed along the way" :/
The only result is a single 24bytes small file (among the usual git infrastructure) .git/svn/refs/remotes/svn/trunk/.rev_map.489a8a1a-d840-0410-b443-d4df6bd36c0d