tags:

views:

47

answers:

3

Hello,

CentOS 5.3 subversion 1.4.2

I have been using git for one of my projects.

However, our company policy has changed and now I have to import my git project into our new subversion repository.

I am just wondering how I can import a project created in git into a subversion repository?

Ater I have imported the project I will have to checkout. However, I would still rather use the git commands and not subversion commands, if that is possible?

Many thanks for any suggestions,

+2  A: 

Git can use an external svn repository: http://www.kernel.org/pub/software/scm/git/docs/git-svn.html

The main commands you must know are:

  • git svn rebase (better than merge in order to keep the history line)
  • git svn dcommit (equivalent to "git push" with a SVN distant repo)

For the complete push process:

  1. Create a SVN repo for your project
  2. Connect your local Git repo to the distant SVN: git svn init -s svn://svnurl/ (if you have a standard SVN repo with a "trunk", a "branches", and a "tags" directories), or specifying theses directories with "-T trunkdir -t tagsdir -b branchesdir"
  3. From your git repo, use git svn dcommit to push your project to SVN. If your project is big, this can be very long (all your local commits are re-played on SVN to keep the global project history)

After that, you can still work with Git in local (if your company policy isn't too strict), and synchronize your work with the distant SVN repository (git svn rebase/dcommit).

Benoit Courtine
+1  A: 

If the company policy is fine with just dumping the code into subversion I would do that and don't bother with the history.

Git supports working with subversion repositories: http://www.kernel.org/pub/software/scm/git/docs/git-svn.html

Let_Me_Be
+2  A: 

I think this is a good start if you want to use git-svn: Pro Git - Git and Subversion.

Per T