I am using git-svn to get a data in svn repo from git. I successfully did import data from git to svn开发者_运维问答 with submodules (I converted submodules as sub-tree of git) using some around work, and it worked fine.
But now I am getting stuck. If I want get a git pull a update data of existing repos of git, it gives me all updated data on my local branch, but I am not able to dcommit to svn using git svn dcommit command it gives me error message as follows:
Unable to determine upstream SVN information from HEAD history
Perhaps the repository is empty. at /usr/libexec/git-core/git-svn line 521.
Any instructions on how to do this would be very much appreciated!
I may be mistaken but my understanding is that git-svn cannot be shared with an upstream git repo only a subversion one.
I totally hosed my git trying to do what you are trying to do, pull from a remote git repo then push to a subversion one.
What I now do is use git to do my SCC, and I copy files into a subversion only controlled local tree and then check that into subversion.
I wrote a ruby script which does the sync between the local git working tree and the local subversion one. It only copies changed files and only the files I care about. Then I do a normal svn ci
from the subversion working tree.
Ok I found the source of my understanding here... http://git-scm.com/docs/git-svn under the heading CAVEATS...
For the sake of simplicity and interoperating with a less-capable system (SVN), it is recommended that all git svn users clone, fetch and dcommit directly from the SVN server, and avoid all git clone/pull/merge/push operations between git repositories and branches. The recommended method of exchanging code between git branches and users is git format-patch and git am, or just 'dcommit’ing to the SVN repository.
Running git merge or git pull is NOT recommended on a branch you plan to dcommit from. Subversion does not represent merges in any reasonable or useful fashion; so users using Subversion cannot see any merges you’ve made. Furthermore, if you merge or pull from a git branch that is a mirror of an SVN branch, dcommit may commit to the wrong branch.
精彩评论