简体   繁体   中英

What is wrong in my syntax?(batch file to migrate from git to svn)

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.

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 ?!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM