Reputation: 51
I have a single SVN repository with the below structure where I am interested in seven projects out of 20+.
I have tried following the migration guide from Bitbucket with additions found through other posts. No matter which of the below commands I try I end up with an empty .git repository.
How would I manage to only get one project out into a git repository using git svn?
Commands tried
git svn clone –std-layout –authors-file=authors.txt http://{companyURL}/{teamName}/trunk/Project4 Project4
git svn clone –trunk=/trunk –branches=/branches –tags=/tags –authors-file=authors.txt http://{companyURL}/{teamName}/trunk/Project4 Project4
git svn clone –trunk=/trunk –branches=/branches –tags=/tags –authors-file=authors.txt http://{companyURL}/{teamName}/trunk/Project4 Project4 --no-minimize-url
git svn clone –trunk=/trunk/NemloginIntegration –branches=/branches/NemloginIntegration –tags=/tags/NemloginIntegration –authors-file=authors.txt http://{companyURL}/{teamName}/trunk/Project4 Project4
Upvotes: 1
Views: 600
Reputation: 51
I ended up doing as this guide from Dan Santos: Migrating-subversion-to-git
Example using my above scenario:
git svn clone --prefix="" --trunk=/trunk/project4/ --branches=/branches/project4 --tags=/tags/project4 --authors-file=authors.txt http://{companyURL}/{teamName} Project4AsGit --no-minimize-url
The different part here is the URL I use for Repo is still on a parent level, and only branches, tags, and the trunk is drilled down to the correct position. --no-minimize-url is making sure git is not going away from these drilled down URLs.
The next thing Dan mentions is to use '--prefix=""', as this will make the below clean-git command works as expected. I did try without which ended up with me not having SVN tags become git tags.
java -Dfile.encoding=utf-8 -jar svn-migration-scripts.jar clean-git
Upvotes: 3