tags:

views:

47

answers:

2

hi there

I m trying out git svn and I m getting this error

Waht I ve done so far is

 git svn init -T <my svn repo> 

then I ve been committing to my git repo with

 git commit -a

then once i did a few of those I did a

 git svn fetch

and then i tried a

 git svn dcommit

however, that fails with

Unable to determine the upstream SVN information from HEAD history. Perhaps the repository is empty

I can also see that the files in my file system are not marked as being used by svn ( not sure if this should happen or not) tho If I browse the svn repo (with repo browser) I can see that the original files are there

after this original failure I tried rebasing without much success ( it throws some other error)

Help appreciated

Thanks

A: 

Just a guess, try git svn clone, then change/commit files, then git svn dcommit. This is the way I usually do it and it works (in my case).

Unknown
+1  A: 

The git svn commands are similar to dealing with a normal remote (the svn remote is named git-svn). fetch just downloads commits from the remote, it doesn't connect them to your tree in any way. It will work if you fetch right after initing, since you don't have a tree yet, but you committed first. You want to use git svn rebase, which will rebase your tree onto the svn head. Normally you git svn fetch right after git svn init, or just use git svn clone, which does both. Once the initial repository is set up you can just use git svn rebase all the time, which fetches and rebases in one operation

Michael Mrozek
hi Michael. thanks for the explanation . I didnt know that I needed to rebase before starting committing to the git repo . I tried giot svn rebase (as i said in my post) but it throws Unable to determine upstream SVN information from working tree dictionary
Miau
@Miau I'm not sure how to fix your existing repository; you may need to create a new one and set up the svn remote properly *before* you commit anything
Michael Mrozek