have to set port every time in command line when trying to trigger any Perforce command

旧街凉风 提交于 2019-12-02 03:33:44

Type:

p4 set P4PORT=myhost:myport

From that point on, "myhost:myport" will be used as the P4PORT when you run commands.

If you use multiple workspaces/servers, P4CONFIG files make it easy to have different sets of settings (based on your working directory), but for a single value, "p4 set" is a nice persistent one-shot method.

There are a couple ways to make myhost:1666 the default. These are, in the order of decreasing precedence:

  1. command-line options (like -p myhost:1666)
  2. the P4CONFIG file
  3. environment variables (%P4PORT%)
  4. on Windows, the registry (use p4 set P4PORT=myhost:1666 to set it)

See the docs here.

In your case, I guess the registry (if on Windows) or the env. var. (if on Linux) is the best option.

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