开发者

git svn partial subversion tree

I'm using git for developing a current project on my local machine. There exists a subversion server which I have to update from time to time, based on my current master branch.

Lets say my directory in the svn is:

project/module/

In this directory there is one general directory and my svn structure

project/module/aDirectory
project/module/myGitDirectory/trunk
project/module/myGitDirectory/branches
project/module/myGitDirectory/tags

Following git-svn I setup my git to use the directory as a upstream:

[svn-remote "svn"]
        url = https://mygit.test.com/project
        fetch = module/myGitDirectory/trunk:refs/remotes/trunk
        branches = module/myGitDirectory/branches/*:refs/remotes/*
        tags = module/myGitDirectory/tags/*:refs/remotes/tags/*

I worked normally in git and committed my changes just with

git svn dcommit

to the partial svn tree

This worked quite fine, until someone else committed in

project/module/aDirectory

which is not in my local git repo.

The failure for git svn dcommit was:

Unable to determine upstream SVN information from HEAD history.

I googled that problem and found some solutions here in so, but the solutions didn't really help me out. Either it didn't work at all or I had to handmerge dozens of files, which I don't want. My current workaround is checkout the complete svn, copy changes from git to svn repo and just commit them.

So my question is, is it possible to use such a partial svn tree within git-svn, the way I do? Did I made any mistake by specifying w开发者_JS百科rong directories for git-svn? Or is git-svn not an appropriate solution for my scenario.

And if I can do this the way I started, what happens with the svn commits to files which are not tracked in my local git?

I'm using the combination of svn and git in some other projects and never ran into any trouble, but there the whole svn tree is also managed in git. So each commit to svn has an appropriate place in my git repo :)


It's weird. But you could clone aDirectory to git also. Just add this to the config

[svn-remote "svn-extra"]
        url = https://mygit.test.com/project
        fetch = aGitDirectory:refs/remotes/aDirectory

After this clone aDirectory from the svn

git svn fetch svn-extra

And try to get the previous one with new one already in your repo

git svn fetch --fetch-all

Probably this could help git-svn to understand this atypical commit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜