How to connect & perform Sync with Perforce on Mac

こ雲淡風輕ζ 提交于 2019-12-22 10:05:31

问题


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

Can any one tell me how to access perforce for command line.

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

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

Perforce client error: Connect to server failed; check $P4PORT. TCP connect to perforce:1666 failed. nodename not servname provided, or not known

Step by step approach to set up Perforce, will be greatly appreciated

Note: P4V gui version is working fine, I need to execute Sync command from Command line for bash script.

Thanks in advance.


回答1:


In addition to downloading the 'p4' executable and placing it in your path (which you have already done), you need to set three configuration settings:

  1. P4PORT, which is the network address of your Perforce server
  2. P4USER, which is your user name that you will use to connect to Perforce
  3. P4CLIENT, which is the name of the workspace that you use on this workstation

You have already figured these out in P4V, as part of entering the data in the connection dialog. But you need to set these variables separately for the command line to know about them.

For example, I might do:

  1. p4 set P4PORT=myserver.example.com:1666
  2. p4 set P4USER=bryan
  3. p4 set P4CLIENT=bryan-dev

and then I would be able to connect with the command line to my Perforce server.

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

  1. export P4PORT=myserver.example.com:1666
  2. export P4USER=bryan
  3. export P4CLIENT=bryan-dev

Or you can use a P4CONFIG file.

Bottom line: set P4PORT, P4USER, and P4CLIENT to match the settings that you use in your P4V connection dialog, and the command line will be ready to go.



来源:https://stackoverflow.com/questions/25640366/how-to-connect-perform-sync-with-perforce-on-mac

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