How to Connect and Sync with Perforce on Mac

I am trying to access perforce and perform a sync operation from the command line on a Mac OS x 10.8.5 machine

Can anyone tell me how to access the command line.

I have placed the p4 client in the / usr / bin directory,

From terminal, when I execute command: P4 or p4 help, im getting below error message.

Perforce Client Error: Failed to connect to server; check $ P4PORT. TCP connect to perforce: 1666 failed. nodename not servname provided or unknown

A step by step approach to setting up Perforce would be greatly appreciated

Note. The P4V gui version works fine, I need to execute the Sync command from the command line for the bash script.

Thanks in advance.

+3


source to share


1 answer


In addition to downloading the "p4" executable and placing it in your path (which you already did), you need to set three configuration parameters:

  • P4PORT, which is the network address of your Perforce server.
  • P4USER, which is your username that you will use to connect to Perforce
  • P4CLIENT, which is the name of the workspace used on this workstation.

You already figured this out in P4V as part of the data entry in the connection dialog. But you need to set these variables separately for the command line to learn about them.

For example, I could do:

  • p4 set P4PORT = myserver.example.com: 1666
  • p4 set P4USER = bryan
  • p4 set P4CLIENT = bryan-dev


and then I can connect to the command line on my Perforce server.

Instead of 'p4 set', you can also use 'export' in your shell:

  • export P4PORT = myserver.example.com: 1666
  • export P4USER = bryan
  • export P4CLIENT = bryan-dev

Or you can use the P4CONFIG file.

Bottom line: set P4PORT, P4USER and P4CLIENT according to the settings you use in the P4V connection dialog and the command is ready to go.

+6


source







All Articles