Using git-p4 to setup a git clone of a perforce client

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 00:28:42

问题


I have a perforce client which maps several perforce paths into my local client. These perforce paths are for libraries and the main code line.

How do I use git-p4 to setup a clone of the entire client in a separate directory?

From what I see git-p4 can only clone specific depot paths. I would like to clone an entire client: suppose my perforce client is test_client. I would like to do:

cd git_area
cp ../perforce/test_client/.perforce .
git-p4 clone 

or something similar which will pull in all the directories into this separate git directory.


回答1:


I believe that most git-p4 operations work on a single Perforce depot path. (I could be wrong on that, I haven't used it often.)

Does your workspace follow a pattern where you have one code line you really work on, and the rest of the files are libraries that you don't modify? In other words is your workspace view something like:

//depot/my_proj/src/... //ws/src/...
//depot/libs/libA/... //ws/libs/libA/...

If so, you could probably use git-p4 on the source code, and continue to get the read-only dependencies from your Perforce workspace.




回答2:


Another alternative would be to use a branch-spec in perforce to combine your perforce paths into a single location.

That would only work if you're happy with just getting the tip, without history.

AFAIK, git-p4 uses p4 print, so it doesn't care about the local mapping.



来源:https://stackoverflow.com/questions/5694250/using-git-p4-to-setup-a-git-clone-of-a-perforce-client

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