You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac端执行P4命令同步项目时遇路径不在客户端根目录错误

问题:Mac下执行P4 sync报错路径不在客户端根目录下

我查了大量相关帖子,没找到针对性的解决方案。在Mac本地终端通过P4命令创建新项目时,遇到错误:Path '/Users/aa/Documents' is not under client's root '/Users/aa/Documents/perforce/p4_project'。相同的命令在Ubuntu、CentOS等机器上可正常执行,仅在Mac上出现该错误。

操作步骤

# pwd
=> /Users/aa/Documents/perforce
# mkdir p4_project
# cd p4_project
# echo "P4CLIENT=aa-p4_project" > .p4config
# p4 client -t MASTER-p4-project
=> 尝试取消部分目录的注释后执行p4 sync
# p4 sync ...
=> 出现上述错误 - `Path '/Users/aa/Documents' is not under client's root '/Users/aa/Documents/perforce/p4_project' ` 

当前环境信息(p4 info输出)

User name: aa
Client name: aa-p4_project
Client host: JYDL743YDFI
Client root: /Users/aa/Documents/perforce/p4_project    <<<<----- 与当前目录一致
Current directory: /Users/aa/Documents/perforce/p4_project
Peer address: 172.16.15.49:62849
Client address: 172.16.15.49
Server address: <server>:<port>
Server root: /p4/root
    :
    :
Case Handling: sensitive

已尝试的无效方案

  • 针对“p4 status 'Path is not under client's root'”问题的解决方案
  • 游戏引擎相关的“Perforce路径不在客户端根目录下”讨论

内容的提问来源于stack exchange,提问作者Daniel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 14:13:24