I've made some progress, at least with an empty test repo:

On master....

git svn init file:///path/to/my-repo -s
git svn fetch

Checking branches now, I see "trunk" in there:

git branch -a
* master
.. snip ..
trunk

So I create a new branch based on that:

git checkout -b temp-branch trunk

My working tree is now empty, just like the svn trunk.

I merge with the master branch (for some reason if I use rebase in
this step I get the dreaded "Unable to determine upstream HEAD..."
error):

git merge master

Now I can perform the dcommit:

git svn dcommit

This pushes the entire merge changeset (i.e. all files now in my
working tree) into the svn repo as expected.

Now if I checkout the master branch and merge the changes (which is
basically a null changeset) from this temporary branch I'm able to
perform svn dcommits from the master.

So I'm halfway towards doing what I need to do, assuming this will
work with an old svn repo that is not empty to begin with.

QUESTION:

Can I trick git into thinking it needs to dcommit every single commit
I've made since I migrated to git?  In other words, can I make it
believe that I had performed the "git svn init" command immediately
after I ported my repo to GitHub (at that commit)?

I'm hoping that doing that will do two things:

1) Make the dcommit sync the tags I've created in git
2) Make the svn repo contain all the same commits as my git repo (not
critical, but a "would be nice").

Cheers,

Chris


On Mar 28, 1:11 pm, Chris Corbyn <[email protected]> wrote:
> Hi All,
>
> I may be trying to do something that is not possible, but I'm hoping
> that there's a way I can do it cleanly.
>
> I used to run a project in a subversion repo on SourceForge.  I
> stopped using them and moved everything to GitHub, using GitHub's
> "importing from svn?" feature.
>
> All has worked great and I'm very happy.
>
> However, many of my end users are not since they don't use git and
> they used to simply have my project set up as a svn:external in their
> own repository.
>
> While I don't want to patch changes manually into subversion
> (especially SourceForge's repo which is horribly slow), I'm
> considering setting up a cron script that syncs my git repo with the
> old subversion repository once an hour or so in the background.
>
> However, I think I may have fundamental issue.  Since moving to git,
> not one single commit has been made to subversion (this is good).
> Everything has been committed in git and pushed up to github.  But,
> does that fact that I didn't use git-svn to create this repository
> mean that I can't backport all of my past 6 months work to subversion?
>
> Because I don't want to break anything, I've tried experimenting on
> disk:
>
> Create a fresh SVN repository as a test:
>
> svnadmin create file://localhost/Users/chris/test-repo
>
> Import a standard layout:
>
> mkdir layout
> mkdir layout/trunk
> mkdir layout/branches
> mkdir layout/tags
>
> svn import layout file://localhost/Users/chris/test-repo
>
> SVN init my git repo:
>
> cd my-git-repo-working-tree
> git svn init -s file://localhost/Users/chris/test-repo
> git svn fetch
>
> Try performing a dcommit:
>
> git svn dcommit
>
> I can't get beyond this error however:
>
> Unable to determine upstream SVN information from HEAD history.
> Perhaps the repository is empty. at /usr/local/git-1.6.0/libexec/git-
> core//git-svn line 431.
>
> Has anybody tried to retroactively turn their git repo (that was once
> based on a svn repo) into a git-svn repo?  Any pointers would be much
> appreciated.
>
> Cheers,
>
> Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GitHub" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/github?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to