git p4 clone has no files

你。 提交于 2019-12-10 14:13:13

问题


I'm migrating from Perforce to git, and in the process I'm trying to get the file structure right.

The current perforce structure is something like this:

//depot
    /android
        /main
        /other_branches
        /core_library
            /main
            /other_branches

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

回答1:


The problem is in this line:

git p4 clone --use-client-spec //p4-git/@all

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

instead.

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:

  • create a dedicated client for git-p4 work
  • make sure P4CLIENT is set to this client whenever you use git-p4
  • avoid changing the view of your git-p4 client


来源:https://stackoverflow.com/questions/21420612/git-p4-clone-has-no-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!