0

I have a local git repo with my current Project. Now I want to commit with the git svn tool, the git repo to a SVN repo.

I've read this post: pushing an existing git reposotory to svn but somehow it's not working in my case.

What I've tried:

/Documents/Workspace (master)
$ git status
On branch master
nothing to commit, working tree clean

Because I'm on Windows I've createt a new Folder inside the svn repo, and checked it out to

/documents/Workspace

/Documents/Workspace (master)
$ ls
.git
Current-Project/
.svn

till now the git repo, and the svn repo are in the same folder.

I think, from the post above, step 1 and 2 are done so far

  1. cd /path/to/git/localrepo
  2. svn mkdir --parents protocol:///path/to/repo/PROJECT/trunk -m "Importing git repo"
  3. git svn init protocol:///path/to/repo/PROJECT -s
  4. git svn fetch
  5. git rebase origin/trunk 5.1. git status 5.2. git add (conflicted-files) 5.3. git rebase --continue 5.4. (repeat 5.1.)
  6. git svn dcommit

Step 3,4,5 are done (in Step 4 there are nothig to fetch because it's an empty folder)

but the git svn dcommit gives me following error:

/Documents/Workspace (master)
$ git svn dcommit
Unable to determine upstream SVN information from HEAD history.
Perhaps the repository is empty. at C:/Users/benjaminulrich/AppData/Local/Programs/Git/mingw64/libexec/git-core\git-svn line 913.

Can't see why it's not working, can anyone help?

Hoehli
  • 154
  • 10
  • Did you actually run the `git svn fetch`? Even if the svn repo is _empty_ git still needs to create the revisions created on it so that you can do the rebase on top of the (fetched) trunk used on step 5. – eftshift0 Oct 11 '18 at 12:29
  • yes i runed the command – Hoehli Oct 11 '18 at 12:30
  • and so I assume that when you are going to run the `git svn dcommit`, you are working on a branch that starts from an svn revision, right? If that is indeed the case (make sure by using git log, for example), I don't know what's going on. – eftshift0 Oct 11 '18 at 12:32
  • Why do you want to do this? – thekbb Oct 11 '18 at 20:37

0 Answers0