How do I get the perforce root directory from the command line? I've tried p4 info
but I'd rather not have to filter this to get at the root. I'm sure there's a way, but I couldn't find it.
Is there a way to get the root in a context sensitive way? For example if I have two workspaces with a hierarchy like A/.../script vs B/.../script I'd expect that the script would return either A or B depending on where it was run from.
If you want your client root in one command run:
p4 -F %clientRoot% -ztag info
You will need the 2014.1 later version of p4 to use this flag.
From OP’s description, they probably want p4 where
. For example, if the client root is /perforce/projects
, then
p4 where //depot/project-1/module-2
will give /perforce/projects/project-1/module-2
. Credit from Bryan’s comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With