Cb_M
Cb_M

Reputation: 307

P4 - change workspace for client

I want to change the workspace client using the p4 command line but i don't know if its possible. You can create, delete or edit workspace using the p4 workspace command, but i want to change the current workspace with a .bat method.

Example:

p4 -c MyClient changeworkspace myNewWorkspace

If you know in first step if it's possible.

Upvotes: 17

Views: 42726

Answers (1)

Bryan Pendleton
Bryan Pendleton

Reputation: 16359

Either set the P4CLIENT environment variable to the name of the workspace you want to be your current workspace, or consistently pass that workspace name as the value of the -c flag on your p4 commands: http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.P4CLIENT.html#1040647

See also these other ways to set the environment variable (many people find P4CONFIG files helpful): http://www.perforce.com/perforce/doc.current/manuals/p4guide/02_config.html#1069873

Upvotes: 23

Related Questions