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?
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.
No interaction between them. Just ignore the . git folder for SVN and the . svn folder for Git and you should be fine.
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).
# 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 ...
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With