linux p4 环境配置,linux p4使用心得

本文详细介绍了如何在Linux系统中配置Perforce(P4)环境,包括设置用户信息、常用P4操作命令以及解决常见错误的方法。通过设置P4PORT、P4CLIENT和P4USER环境变量,可以连接到P4服务器。文章还列举了如`p4 add`、`p4 change`、`p4 submit`等关键命令的用法,并提供了查看和处理变更列表、重置文件状态的技巧。在遇到错误时,例如P4PORT、P4CONFIG或P4PASSWD问题,文章也给出了相应的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.设置使用者信息

export P4PORT=perforce-wsx.com:1966 && export P4CLIENT=build-toolchain-centos5-32-dev31 && export P4USER=wsx

export PATH=$PATH:/build/apps/bin

2.p4操作命令

$ p4 -h //查看帮助信息

$ p4 changes |grep wsx //查看wsx修改的changelist

$ p4 changes -s pending -u wsx //查看wsx修改的状态为pending的changelist

$ p4 change 1037167 //修改changelist中版本号是1037167

$ p4 change -d  1037167//从changelist中删除1037167

$ p4 client

find . -type f -print | p4 -x - add //把目录下的文件都添加到p4 open file list里

p4 info

p4 revert  filename// To revert a file to its unopened state

p4 revert  -a # 这个命令会将当前目录以及其子目录下所有的已打开并且没有修改的文件重置

p4 revert -c 12345 //... #to revert all files in my pending changelist 12345

p4 change -d 12345 #to delete the now-empty changelist

p4 add filename//

p4 add -c 13 *  #Opens all the files within the user’s current directory foradd, and links these files to changelist13.

p4 opened // To list all opened files

p4 change // To create or edit a new changelist

p4 submit // To copy all open files to the depot

p4 submit -c 12345

p4 delete // To open a file for deletion

p4 change -d changelist(1234)

p4 sync // To read files from the depot into the client workspace

p4 move // To move(rename) a file

p4 edit // To open a file for edit

p4 edit filename  对文件进行编辑,相当于图形界面中的check out

find . -type f -print -name ToDo.txt| p4 -x - edit //把当前文件夹下的所有名字为ToDo.txt的文件进行check out

Root:   /home/tcuser/workspace//工作空间

View:

//toolchain/main/src/...      //build-toolchain-centos5-32-dev31/src/...  //客户端相对Root的首层路径

//toolchain/main/lin32/...   //build-toolchain-centos5-32-dev31/lin32/...

客户机器名

3.验证编译是否成功

strings -a * | grep -i openssl |less //查看编译的包

find ../../lin32/pwdutils-3.0-1/ -type f -exec strings -f {} \; | grep ": OpenSSL [0-9]" | more

post-review 1037167 --submit-as="wsx" --user="wsx"

$ p4 submit -c 1037167//本地提交文件到server

4.遇到错误和解决方法

1.error:

* You must fix these errors before submitting:

* - "Review URL" is required.

solve:p4 change NUM

增加post-review URL

Error: Client '' unknown - use 'client' command to create it. Solve:create the client by running p4 client on the command line (export P4CONFIG=.p4config)or using P4V

unable to connect to the server perforce as user. or Connect to server failed; check $P4PORT

Remember that P4PORT not only specifies the port you connect to but also the host.

Perforce password (P4PASSWD) invalid or unset. Solve: P4CONFIG没有设置,或者是你没有p4 login

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值