0

I need to migrate some git repositories to subversion.

Some of the projects have a lot of history which i want to preserve. Also the author names have to stay the same.

After tinkering around and searching for other ways to achieve this, i still cant seem to get it to work properly.

The git repository i need to migrate is a local repository on my c drive. The svn server i need to migrate these repositories to is on the local network.

This is what i came up with so far:

svn mkdir --parents  SVNSERVER/DestinationRep
git svn clone -sA authors.file  svn://LocalSourceFolder
cd LocalSourceFolder
git remote add origin localSourceFolderPath
git fetch origin
git checkout -b old_master origin/master
git rebase --onto master --root
git svn dcommit

pause

when i try to execute, its also shows this error:

"Unable to determine upstream SVN information from HEAD history."

now, before people tell me, i know similar questions have been asked here before, i read a lot of them, but they dont seem to provide the missing ´key´ that would make this work.

Any help is appreciated.

Console output:

svn mkdir --parents  h
ttp://192.168.10.106/svn/Itp-tools/BackupUploader
svn: E205007: Konnte keinen externen Editor zur Eingabe der Logmeldung bestimmen
. Setzten Sie entweder die $SVN_EDITOR Umgebungsvariable oder verwenden Sie die
--message (-m) oder --file (-F) Optionen
svn: E205007: Keine der Umgebungsvariablen SVN_EDITOR, VISUAL oder EDITOR ist ge
setzt und keine Laufzeitkonfigurationsoption »editor-cmd« wurde gefunden

git svn clone -sA auth
ors.file  svn://BackupUploader
Can't open authors.file No such file or directory
-- i can handle this when other errors are resolved

cd BackupUploader

git remote add origin C:\Users\msc\Desktop\git-tf-2.0.2.20130214\BackupUploader

git fetch origin
From C:\Users\msc\Desktop\git-tf-2.0.2.20130214\BackupUploader
 * [new branch]      master     -> origin/master

git checkout -b old_master origin/master
Branch old_master set up to track remote branch master from origin.
Switched to a new branch 'old_master'

git rebase --onto master --root
First, rewinding head to replay your work on top of it...
Fast-forwarded old_master to master.

git svn dcommit
Unable to determine upstream SVN information from HEAD history.
Perhaps the repository is empty. at C:\Program Files\Git\mingw64/libexec/git-cor
e\git-svn line 866.
Master Azazel
  • 612
  • 1
  • 12
  • 32

1 Answers1

1

Less important

  • You tried to create folder in http-based repo and forgot to add commit-message (creating folder is commit) with -m

More important

  • You tried to clone from svn-based repository (do you have svnserve?)
  • http-URL and svn-URL doesn't correlate and can't correlate in these forms at all

http://192.168.10.106/svn/Itp-tools/BackupUploader and svn://BackupUploader ?!

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • i will definitely add the -m to the mkdir and post the output from that. this may be an error of mine, maybe i filled in the wrong path - i wanna clone from a git repository thats in the folder BackupUploader, and this has to go to a svn repository, on the local svn server or my local drive and i will then commit that to the server in my script thatd be the 192.168.10.106 server... how would you change the script? – Master Azazel Apr 30 '16 at 18:40
  • @MikeAzazel - I don't use Git, but try to read http://stackoverflow.com/questions/661018/pushing-an-existing-git-repository-to-svn (or only 1-st answer http://stackoverflow.com/a/772881/960558) and compare with your code – Lazy Badger Apr 30 '16 at 19:43
  • @MikeAzazel - additional hints: local SVN-repo is accessible with `file:///` protocol, `git svn init` applied to **existing Git-repo** – Lazy Badger Apr 30 '16 at 19:46
  • thanks, that was relly helpful!! i now am able to commit my git repository to our svn servers directly using dcommit does not seem to preserve the history... any clues about that? – Master Azazel May 02 '16 at 14:04
  • @MikeAzazel - my (old time ago) dcommits always preserve Git-history as is, I'm out of ideas - ask Git-boys – Lazy Badger May 03 '16 at 05:20
  • this is what finally helped http://eikke.com/importing-a-git-tree-into-a-subversion-repository/ thanks! – Master Azazel May 03 '16 at 07:10