Error with Git SVN clone

前端 未结 6 2109
忘了有多久
忘了有多久 2021-01-17 10:58

I am migrating several projects from SVN to Git, and I am using Git\'s \'svn clone\' feature. I am trying to run the following:

git svn clone --stdlayout --a         


        
6条回答
  •  醉酒成梦
    2021-01-17 11:24

    No idea if this was your problem, but I was having the same error git svn clone/git svn fetch-ing a large svn repo. Sometimes it would complain about couldn't truncate file, sometimes it would complain about too many open files, but it would die with one of them pretty reliably a fair ways into the process, usually on a particularly large revision (initially, retrying the fetch worked, but eventually it would start reliably dying on the same huge revision).

    To fix the latter, I ran ulimit -n 4096 (ulimit -n reported a default limit for me of 1024), increasing the limit on open file handles by a factor of four. But rather than just fixing the "too many open files" error, it seems to have fixed the couldn't truncate file as well. While checking the source code indicates it's truncating by file handle (and therefore shouldn't need to open a new file handle to do so, risking handle exhaustion), this change did seem to fix the problem as well, so it's possible the underlying implementation does something that runs up against the open handles limit and dies in a way that implicate truncate, even though it was the open files limit itself that was responsible.

提交回复
热议问题