Reputation: 166
I've successfully used git svn
to fetch a project from a very old svn server.
The output of git svn info
shows:
master
points to https://svn-server/repos/myProject
.feature-new
points to https://svn-server/repos/branches/myProject
.feature-new
into master
changes the mapping, causing master
to point to https://svn-server/repos/myProject/myProject/myBranch
.How can I fix this?
SVN repository:
git svn init https://svn-server/repos --trunk=myProject --branches=branches/{myProject} myProject
git config svn.authorsfile ~/authors.txt
.git/config
:[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[svn-remote "svn"]
url = https://svn-server/repos/myProject
fetch = myProject:refs/remotes/git-svn/trunk
branches = branches/{myProject}/*:refs/remotes/feature-new/*
[svn]
authorsfile = ~/authors.txt
git svn fetch
git branch -r
results:
feature-new/myProject
git-svn/trunk
feature-new/myProject
and rename:git checkout feature-new/myProject
git switch -c feature-new
Upvotes: 2
Views: 107
Reputation: 18930
I can't really recommend this, but then I can't really recommend using an ancient SVN repository either!
Make the entire branch diff a patch and apply it
git svn fetch
git checkout feature
git diff master > ../feature.patch
git checkout - # back to master
git apply ../feature.patch
I don't have a test instance, but you can make what happened a little more obvious by embedding the git log into the commit message, which has a fairly high limit Maximum length for SVN comment
Finally, though it may not be feasible for your case, converting the project to git or mercurial may be the best move for sustainability
Upvotes: 0