尝试触发任何 Perforce 命令时,每次都必须在命令行中设置端口 [英] have to set port every time in command line when trying to trigger any Perforce command
问题描述
我是 Perforce 的新手,需要在命令行中工作,我很困惑为什么教程网站上的所有命令都写成 $
p4 命令,但我必须添加每次尝试触发该命令时的端口,例如,对于 $
p4 同步,我必须每次输入 $
p4 -p myhost:myport sync 甚至在我之后登录后,如果我错过了主机和端口,就像我只是输入 $
p4 sync 一样,程序就会挂在那里......有人可以提供一些建议吗?
I'm new to Perforce, need to work in command line, i'm so confused why all the commands on the tutorial websites all write like $
p4 command, but I have to add the port every time when try to trigger that command, for an example, for $
p4 sync, i have to type $
p4 -p myhost:myport sync every time even after I logged in, if i missed the host and port, like if i just typing $
p4 sync, the program will just hang in there... anyone can provide some suggestions?
推荐答案
类型:
p4 set P4PORT=myhost:myport
从那时起,myhost:myport"将在您运行命令时用作 P4PORT.
From that point on, "myhost:myport" will be used as the P4PORT when you run commands.
如果您使用多个工作区/服务器,P4CONFIG 文件可以让您轻松拥有不同的设置集(基于您的工作目录),但对于单个值,p4 集"是一种不错的持久性一次性方法.
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.
这篇关于尝试触发任何 Perforce 命令时,每次都必须在命令行中设置端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!