将分支克隆或拉入 PhpStorm 时出现无效路径错误

问题描述

在 Windows 机器上使用 PHPStorm 并尝试从远程存储库执行 git pullgit clone 并返回以下内容

error: invalid path 'Docs/AdminHelp/en/Inventory/Contract financials | Financial fields calculation (recalculate_fields).md'
fatal: unable to checkout working tree

其他团队成员正在使用相同的存储库,但在我这边,我不断收到此错误。有没有办法解决这个问题?

解决方法

Docs/AdminHelp/en/Inventory/Contract financials | Financial fields calculation (recalculate_fields).md
                                               ^^^

A pipe is not allowed in Windows file paths,因此您需要:

  • 仔细检查您的同事是否在 Linux/Mac 上使用存储库
  • 使用基于 Linux 的 VM(或 WSL2,如果您的 Windows 是最新的 Windows 10)

在那个基于 Linux 的环境中,您将能够检出存储库。

或者,您可以要求同事使用更合理的名称git mv/重命名该文件。