git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git svn migration does not work because fatal git checkout updating paths is incompatible with switching branches

From
Carlos Martín Nieto <cmn@elego.de>
Date
Jan 25, 2012, 19:09 UTC
Message-ID
<1327518563.31804.82.camel@centaur.lab.cmartin.tk>
In-Reply-To
<4F20442A.1080005@gmx.de>
On Wed, 2012-01-25 at 19:04 +0100, Christine Bauers wrote:
Show 57 quoted lines
> Hi there,
> 
> I´m trying to migrate a repository from svn to git which branches and 
> tags with the following migration script:
> 
> git svn clone --no-metadata --stdlayout --A ../users.txt 
> svn://host/svn/project/subproject subproject
> 
> cd subproject
> git config svn.authorsfile ../../users.txt
> git svn fetch
> 
> git checkout -b branch1 remotes/branch1
> git checkout -b branch2 remotes/branch2
> git checkout -b branch3 remotes/branch3
> 
> git checkout -b src_v1 remotes/tags/src
> git checkout master
> git tag src src_v1
> git branch -D src_v1
> 
> git checkout -b WebContent_v1 remotes/tags/WebContent
> git checkout master
> git tag WebContent WebContent_v1
> git branch -D WebContent_v1
> 
> and get the follwoing errors:
> 
> W: Ignoring error from SVN, path probably does not exist: (160013): 
> Filesystem has no item: Datei nicht gefunden: Revision 8966, Pfad 
> »subproject«
> W: Do not be alarmed at the above message git-svn is just searching 
> aggressively for old history.
> This may take a while on large repositories
> fatal: git checkout: updating paths is incompatible with switching branches.
> Did you intend to checkout 'remotes/branch1' which can not be resolved 
> as commit?
> fatal: git checkout: updating paths is incompatible with switching branches.
> Did you intend to checkout 'remotes/branch2 which can not be resolved as 
> commit?
> fatal: git checkout: updating paths is incompatible with switching branches.
> Did you intend to checkout 'remotes/branch3' which can not be resolved 
> as commit?
> fatal: git checkout: updating paths is incompatible with switching branches.
> Did you intend to checkout 'remotes/tags/src' which can not be resolved 
> as commit?
> error: pathspec 'master' did not match any file(s) known to git.
> fatal: Failed to resolve 'src_v1' as a valid ref.
> error: branch 'src_v1' not found.
> fatal: git checkout: updating paths is incompatible with switching branches.
> Did you intend to checkout 'remotes/tags/WebContent' which can not be 
> resolved as commit?
> error: pathspec 'master' did not match any file(s) known to git.
> fatal: Failed to resolve 'WebContent_v1' as a valid ref.
> error: branch 'WebContent_v1' not found.
> 
> How do I solve this problem?

First try to figure out where the problem happens. It could be that git-svn isn't recognising the branches properly, or that the layout isn't what it expects or any number of things.

What layout does the repo have? Does it correspond to what git-svn is expecting? All those error messages come from the fact that you're telling git some starting points that it can't find. Make sure those exist and they have the name you're giving. What does `git branch -a` say? You're presumably not giving us the real names, so we can't tell if there are problems there.

If you're looking to migrate completely, something like svn-dump-fast-export ( https://github.com/barrbrain/svn-dump-fast-export ) might get you there better.

   cmn
Previous: Christine BauersNext: Christine Bauers
Message 2 of 4 in “Git svn migration does not work because fatal git checkout updating paths is incompatible with switching branches”
  1. Christine BauersJan 25, 2012
  2. Carlos Martín NietoJan 25, 2012
  3. Christine BauersJan 26, 2012
  4. David BarrJan 27, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.