1

I have a local svn repo on my hard-drive which has directory structure as follows :

[root]
Project1/
Project2/
Project3/
Project4/

As you noticed this not at all a standard SVN layout.

Now I want to create a new git repo importing all these projects. I won't mind directory strucutre changes unless all of these projects are in single folder.

I have TortoiseSVN and TortoiseGit installed.

I have tried following but I am not able to figure out the inner workings of these or I am just way too new for this.

Please help me out here.

Thanks,

Community
  • 1
  • 1
Shardul
  • 27,760
  • 6
  • 37
  • 35

2 Answers2

1

I think that you should not mix different projects into one Git repository. My recommandation would be to create one Git repo per project. Git in contrast to SVN does not allow subtree commits and updates. Putting all these projects into one repository makes the git push / pull / merge workflow a bit awkward.

Imagine that you are working on Project 1. You happily add and commit stuff. Now you want to push to the server, but you cannot because a coworker has push modifications to Project 2. This does not make sense to me.

If you want all 4 projects combined in one master project, you can still create a new Git repository and add those four projects as submodules.

To create a Git repo from one project, you simply have to git svn clone SVN_REPO. I recommend to extract the SVN ignores to a gitignores file with git svn show-ignore >>.gitignore. Afterwards create the master project and use git submodule add to add your projects.

topek
  • 18,609
  • 3
  • 35
  • 43
  • Hi, I know its not good and all, but I have been using this for many months now and cannot go back changing structure much. Isn't there any such way by which I can just retain the commit history plus migrate this into a git repo ? – Shardul May 22 '12 at 06:47
-1

I was not able to found any feasible solution to this.

I just exported everything in a empty git repo and pushed it over. Loosing all my revision history.

Anyways thank you everyone. I hope some one will be able to resolve this.

Shardul
  • 27,760
  • 6
  • 37
  • 35