git p4 clone没有文件 [英] git p4 clone has no files
问题描述
我正在从Perforce迁移到git,并且在此过程中,我试图使文件结构正确.
I'm migrating from Perforce to git, and in the process I'm trying to get the file structure right.
当前的perforce结构是这样的:
The current perforce structure is something like this:
//depot
/android
/main
/other_branches
/core_library
/main
/other_branches
我正在用git拍摄这样的东西:
and I'm shooting for something like this in git:
/android
/core_library
我按如下所示设置了客户规范视图(稍后我会担心分支):
I set up my client spec View as follows (I'll worry about the branches later):
//depot/android/main/... //p4-git/android/...
//depot/android/core_library/main/... //p4-git/core_library/...
当我运行以下命令时,将显示完整的提交历史记录,但没有文件.
Wen I run the following, the full commit history appears, but no files.
set P4CLIENT=p4-git
git p4 clone --use-client-spec //p4-git/@all
推荐答案
问题出在这一行:
git p4 clone --use-client-spec //p4-git/@all
这里您要传递客户路径(//p4-git
),但是git-p4需要一个仓库路径.这会在以后尝试将Perforce仓库路径映射到Git路径时引起问题.尝试运行
Here you're passing a client path (//p4-git
), but git-p4 expects a depot path. This causes problems later on when it tries to map Perforce depot paths to Git paths. Try running
git p4 clone --use-client-spec //depot/android/main/@all
相反.
请记住,如果指定--use-client-spec
,则git-p4将自动使用您的客户端规范,无论哪种规范.它还会记住此选择,并将其用于将来的git-p4命令.可能是一个好主意:
Bear in mind that if you specify --use-client-spec
, git-p4 will automatically use your client spec, whichever one that is. It will also remember this choice and use it for future git-p4 commands. It's probably a good idea to:
- 为git-p4工作创建专用客户端
- 确保每次使用git-p4时都为此客户端设置
P4CLIENT
- 避免更改git-p4客户端的视图
这篇关于git p4 clone没有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!