Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent git svn rebase to create empty directories

In short the problem is, when I run git svn rebase, I got a bunch of "creating empty directory: ..."

At the svn side, in trunk, there's a directory named TOD(Trunk Only Dir), with a lot of files in it. in another branch, there's no such directory at all.

When I cloned this svn repository with git svn, on master things are all right, but on the branch, I got the TOD directory and the same directory structure except there's no files in it.

If I rm the TOD directory (safe because git doesn't track directories), and switch to master and run git svn rebase, I got the "creating empty direcotry" messages, then when I checkout the branch, the TOD directory comes back.

All in all, the question is, how to prevent git svn from creating empty TOD directories on the branch?

like image 786
ryenus Avatar asked Jun 23 '11 09:06

ryenus


People also ask

What does git SVN rebase do?

Getting the latest changes from SVN The equivalent to git pull is the command git svn rebase . This retrieves all the changes from the SVN repository and applies them on top of your local commits in your current branch.

Can I use git and SVN at the same time?

No interaction between them. Just ignore the . git folder for SVN and the . svn folder for Git and you should be fine.

Which feature of git makes attractive over SVN?

Git has the advantage that it's MUCH better suited if some developers are not always connected to the master repository. Also, it's much faster than SVN. And from what I hear, branching and merging support is a lot better (which is to be expected, as these are the core reasons it was written).

How do I clone a repository in SVN?

# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...


1 Answers

I believe @ben-tebulin is correct, that by doing

git config svn-remote.svn.automkdirs false
git config svn.rmdir true

should make things right. Unfortunately I soon moved to other projects and didn't have a chance to verify it.

At the time of writing this, I, almost lost my svn-fu, did a test and couldn't reproduce the problem, and it looks git-svn can now switch between branches cleanly.

like image 168
ryenus Avatar answered Oct 26 '22 08:10

ryenus