0

I am trying to migrate a bunch of SVN repos to GitHub. It is important for the client to keep his history since it contains important intellectual property information. I am at the stage on my test repo where I have to git svn clone the repository but the SVN is not in the standard layout and I can't for the life of me determine how the layout is related to the required trunks, branches and tags.

The root of the repo looks like this:

SVN root

The statmod folder has the most in it and looks like this:

statmod folder

I'm going insane trying to get this to work.

tripleee
  • 175,061
  • 34
  • 275
  • 318
Tallands
  • 3
  • 1
  • Are those 4 plain branches? – eftshift0 Sep 13 '22 at 02:58
  • If they are branches, just use `git svn init` specifying them as trunks separately (which is supported by `git svn`). – eftshift0 Sep 13 '22 at 02:59
  • .... or the patent directory as `branches`, which is simpler and should give the same final result. – eftshift0 Sep 13 '22 at 03:02
  • I have tried adding --branches=/dglm/ --branches=/new/ --branches=/old/ --branches=/statmod/ but that hasn't worked. I believe that I need git clone because I need to use the --authors-file=authors.txt option for the history to transfer properly – Tallands Sep 13 '22 at 04:39
  • The "standard" layout is merely a common convention; many SVN repos do not adhere to it. I rembember learning about it only after having used Subversion for some time, and being vaguely miffed that it forced you to expose a structure which should have been hidden. – tripleee Sep 13 '22 at 07:10
  • @Tallands `--branches` doesn't do what you think it does. Check the example in [this question](/questions/72814333/merge-folders-as-branches-when-doing-git-svn-clone); then set the mapping you've got in `.git/config`. – ulidtko Sep 13 '22 at 14:33

1 Answers1

2

It looks like the directories listed in / are the branches.... so, try this:

git init . # work on a brand new git repo
git svn init --branches=/ path-to-statmod
# the previous command assumes that the repo is the path that provided the first list that you gave us (and so --branches points to its root, so that you get 4 branches)
git svn fetch

And wait paciently.

A little explanation: --branches tells git svn a directory in the svn repo where each one of its subdirectories is a branch. It looks like the first list there has the 4 branches in the project. Can you confirm if that's the case by looking at the content of another branch, like new?

eftshift0
  • 26,375
  • 3
  • 36
  • 60
  • Sorry for the delayed response, took some time off work. I have tried the above and it seems to fetch all the revisions from statmod when I run git svn fetch. However it just creates ASCII text files named CITATION and NEWS then doesn't appear to do anything else, I let it sit for a while. /new simply contains an R script, that's the entire folder. Does this mean that it isnt a branch? – Tallands Sep 29 '22 at 01:29