Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I download files from perforce to a location other than a workspace?

I want to get files from Perforce without putting them into a workspace.

E.g. I have made changes in 2 files.

file1.cs 
file2.cs

Now I want to build the project using updated file1.cs, so I want to get latest files except for file1.cs.

I thought I will get another local copy of project and build it.

like image 782
meetjaydeep Avatar asked Dec 28 '22 04:12

meetjaydeep


2 Answers

I'm not sure what you really want to do, but you can get the contents of a file from the depot without using a workspace definition by using "p4 print". Example:

>p4 print -o fileName.cs //depot/path/to/fileName.cs
like image 89
rjnilsson Avatar answered Apr 09 '23 05:04

rjnilsson


As far as I am aware you cannot sync files from a Perforce depot without using a workspace since this is the way it tracks what version of files you have in your workspace and also where to put them on your local machine (as well as a few other things). I'm not sure I entirely understand your problem but if what you need to do is get another copy of the file1.cs you have in the depot without removing the changes you have to it you can simply copy the changes to another location or shelve them and re-sync the file. The more complete and less dangerous solution is to create another workspace pointing to a different physical location on your machine but the same depot location. This explains how to create a workspace if you need it: http://www.perforce.com/perforce/doc.062/manuals/boilerplates/quickstart.html Make sure the 'Root' path is different to that of your current workspace, you can check what your current workspaces root is by going to the workspace tab in P4V and viewing it. Once you have created the new workspace create a new connection and select it then sync the file(s) you need.

like image 41
Ductsoup Avatar answered Apr 09 '23 05:04

Ductsoup