Search code examples
gitsvndirectorygit-svntrunk

Using git-svn without "trunk" sub-directory


I'm using git-svn to checkout a standard SVN repository such as this one:

http://example.com/
    - trunk
    - branches
    - tags

with this command:

git svn clone -s http://example.com/

The problem is that git-svn is creating a "trunk" sub-directory in the target folder. Instead of having this kind of directory structure:

c:\www\example

I'm having this:

c:\www\example\trunk

So how to prevent git-svn from putting everything in this trunk folder, while still using the standard SVN layout? Basically, I would want "c:\www\example" to contain whatever I'm currently working on, whether it's the trunk, a branch or a tag. On the other hand, I also need git-svn to correctly map the git branches and tags to the correct SVN folders. Can this be done with git-svn or am I missing something?


Solution

  • You should run:

    git svn clone -s http://example.com/ .
    

    (dot at the end tells git-svn to clone into the current directory, see git svn --help for more information).