简体   繁体   English

git2svn无法创建符号链接(文件名太长)

[英]git2svn unable to create symlink (File name too long)

I installed svn2git to quickly convert SVN repositories to GIT. 我安装了svn2git以快速将SVN存储库转换为GIT。 I tried the converting procedure on a different machine (Ubuntu 16.04) and a different SVN repository which worked without a problem. 我在不同的机器(Ubuntu 16.04)和不同的SVN存储库上尝试了转换过程。

Right now I am on Linux Mint Cinnamon with a different (but very simillar) SVN repository. 现在我在Linux Mint Cinnamon上使用了一个不同的(但非常类似的)SVN存储库。

git clone https://my.git.com/repository.git
cd repository
svn2git svn://my.svn.com/repository --authors ../authors_transform.txt

.
.
.

error: unable to create symlink asp/layer/man/rep/onewith_totalmax_victory.php (File name too long)
read-tree -m -u -v HEAD HEAD: command returned error: 128

I have read about the /home encryption possibility (as a file length limit), which is not my case. 我已经读过/ home加密可能性(作为文件长度限制),这不是我的情况。 Tried touching random string 尝试触摸随机字符串

touch Etiam_tortor_est0_placerat_sit_amet_dolor_in0_ultricies_malesuada_nisi-_Aenean_et_urna_enim-_Vivamus_porta0_velit_et_pulvinar_fermentum0_urna_lacus_tempor_sapien0_et_laoreet_tellus_elit_nec_ligula-_Nulla_iaculis0_libero_eget_rutrum_mattis0_nisl_velit_vive

Which is 256 characters and creates the file. 这是256个字符并创建文件。

How to deal with this? 怎么处理这个?

EDIT: The problem occurs on macOS Sierra aswell. 编辑:问题发生在macOS Sierra上。

Conversion broke the symlink try this: 转换打破了符号链接试试这个:

git clone --no-checkout https://my.git.com/repository.git
cd repository
git config core.symlinks false
git checkout <branch>

After all it seems it has been an issue with a specific file that was symlink and a file at the same time? 毕竟它似乎是一个特定文件的问题,同时是符号链接和文件?

Anyways manually fixing the file in SVN and then performing the conversion fixed the issue. 无论如何手动修复SVN中的文件然后执行转换修复了问题。

The svn2git tool you used uses git-svn under the hood, so it is not suitable for "quickly convert" an SVN repository. 您使用的svn2git工具在引擎盖下使用git-svn ,因此它不适合“快速转换”SVN存储库。

There are pleny tools called svn2git , the probably best one is the KDE one from https://github.com/svn-all-fast-export/svn2git . 有所谓的pleny工具svn2git中,可能是最好的一个是KDE一个https://github.com/svn-all-fast-export/svn2git I strongly recommend using that svn2git tool. 我强烈建议使用该svn2git工具。 It is the best I know available out there and it is very flexible in what you can do with its rules files. 这是我所知道的最好的,它可以非常灵活地使用它的规则文件。

The svn2git you used is based on git-svn and git-svn is not the right tool for one-time conversions of repositories or repository parts. 您使用的svn2git基于git-svngit-svn 不是用于一次性转换存储库或存储库部件的正确工具。 It is a great tool if you want to use Git as frontend for an existing SVN server, but for one-time conversions you should not use git-svn , but svn2git which is much more suited for this use-case. 这是一个伟大的工具,如果你想使用Git的作为前端为现有的SVN服务器,但对于一次性转换,你应该使用git-svn ,但svn2git这是该用例更加适合。

If you are not 100% about the history of your repository, svneverever from http://blog.hartwork.org/?p=763 is a great tool to investigate the history of an SVN repository when migrating it to Git. 如果您不是100%关于存储库的历史记录, svneverever来自http://blog.hartwork.org/?p=763的 svneverever是一个很好的工具,用于调查SVN存储库在将其迁移到Git时的历史记录。


Even though git-svn (or the wrong svn2git in your case) is easier to start with, here are some further reasons why using the KDE svn2git instead of git-svn is superior, besides its flexibility: 即使git-svn (或者你的情况下错误的svn2git )更容易入手,这里有一些其他原因,为什么使用KDE svn2git代替git-svn是优越的,除了它的灵活性:

  • the history is rebuilt much better and cleaner by svn2git (if the correct one is used), this is especially the case for more complex histories with branches and merges and so on 通过svn2git (如果使用正确的历史)重建历史更好更清晰,对于更复杂的分支和合并历史记录尤其如此等等
  • the tags are real tags and not branches in Git 标签是真正的标签而不是Git中的分支
  • with git-svn the tags contain an extra empty commit which also makes them not part of the branches, so a normal fetch will not get them until you give --tags to the command as by default only tags pointing to fetched branches are fetched also. 使用git-svn标签包含一个额外的空提交,这也使它们不属于分支,因此正常的fetch将不会得到它们,直到你给命令--tags ,因为默认情况下只提取指向提取的分支的标签。 With the proper svn2git tags are where they belong 适当的svn2git标签是他们所属的地方
  • if you changed layout in SVN you can easily configure this with svn2git , with git-svn you will loose history eventually 如果您在SVN中更改了布局,您可以使用svn2git轻松配置它,使用git-svn最终会丢失历史记录
  • with svn2git you can also split one SVN repository into multiple Git repositories easily 使用svn2git您还可以轻松地将一个SVN存储库拆分为多个Git存储库
  • or combine multiple SVN repositories in the same SVN root into one Git repository easily 或者将同一SVN根目录中的多个SVN存储库轻松组合到一个Git存储库中
  • the conversion is a gazillion times faster with the correct svn2git than with git-svn 使用正确的svn2git比使用git-svn快转换数倍

There are many reasons why git-svn is worse and the KDE svn2git is superior. git-svn更糟糕且KDE svn2git更优越的原因有很多。 :-) :-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM