在Perforce中删除文件的命令行语法是什么?

时间:2021-08-22 00:11:48

I am creating some build scripts that interact with Perforce and I would like to mark for delete a few files. What exactly is the P4 syntax using the command line?

我正在创建一些与Perforce交互的构建脚本,我想标记删除一些文件。使用命令行的P4语法究竟是什么?

4 个解决方案

#1


7  

p4 delete filename

(output of p4 help delete)

(p4输出帮助删除)

delete -- Open an existing file to delete it from the depot

delete - 打开现有文件以从库中删除它

p4 delete [ -c changelist# ] [ -n ] file ...

p4删除[-c changelist#] [-n]文件...

Opens a file that currently exists in the depot for deletion.
If the file is present on the client it is removed.  If a pending
changelist number is given with the -c flag the opened file is
associated with that changelist, otherwise it is associated with
the 'default' pending changelist.

Files that are deleted generally do not appear on the have list.

The -n flag displays what would be opened for delete without actually
changing any files or metadata.

#2


7  

Teach a man to fish:

教一个人钓鱼:

  • p4 help - gets you general command syntax
  • p4 help - 获取通用命令语法

  • p4 help commands - lists the commands
  • p4 help命令 - 列出命令

  • p4 help <command name> - provides detailed help for a specific command
  • p4 help <命令名称> - 提供特定命令的详细帮助

#3


2  

http://www.perforce.com/perforce/doc.062/manuals/boilerplates/quickstart.html

Deleting files

To delete files from both the Perforce server and your workspace, issue the p4 delete command. For example:

要从Perforce服务器和工作区中删除文件,请发出p4 delete命令。例如:

p4 delete demo.txt readme.txt

The specified files are removed from your workspace and marked for deletion from the server. If you decide you don't want to delete the files after all, issue the p4 revert command. When you revert files opened for delete, Perforce restores them to your workspace.

指定的文件将从工作区中删除,并标记为从服务器中删除。如果您决定不想删除文件,请发出p4 revert命令。当您还原为删除而打开的文件时,Perforce会将它们还原到您的工作区。

#4


0  

Admitted - it takes a (small) number of steps to find the (excellent!) Perforce user guide online in the version that matches your installation and get to the chapter with the information you need.

已承认 - 在与您的安装相匹配的版本中,需要(少量)步骤才能在线查找(优秀!)Perforce用户指南,并获取所需信息的章节。

Whenever I find myself in need of anything about the p4 command line client, I rely on the help Perforce have built into it. Accessing it could not be easier:

每当我发现自己需要关于p4命令行客户端的任何内容时,我都依赖于Perforce内置的帮助。访问它并非易事:

  1. on the command line, enter p4
  2. 在命令行上,输入p4

This gets you to the information Michael Burr has shown in his answer (and some more). If you do not get a help screen right away, something is wrong with our client configuration, e.g. P4PORT is not set properly. You obviously need to fix that first.

这将让您了解Michael Burr在他的回答中所展示的信息(以及更多信息)。如果您没有立即获得帮助屏幕,我们的客户端配置出现问题,例如: P4PORT设置不正确。你显然需要先修复它。

#1


7  

p4 delete filename

(output of p4 help delete)

(p4输出帮助删除)

delete -- Open an existing file to delete it from the depot

delete - 打开现有文件以从库中删除它

p4 delete [ -c changelist# ] [ -n ] file ...

p4删除[-c changelist#] [-n]文件...

Opens a file that currently exists in the depot for deletion.
If the file is present on the client it is removed.  If a pending
changelist number is given with the -c flag the opened file is
associated with that changelist, otherwise it is associated with
the 'default' pending changelist.

Files that are deleted generally do not appear on the have list.

The -n flag displays what would be opened for delete without actually
changing any files or metadata.

#2


7  

Teach a man to fish:

教一个人钓鱼:

  • p4 help - gets you general command syntax
  • p4 help - 获取通用命令语法

  • p4 help commands - lists the commands
  • p4 help命令 - 列出命令

  • p4 help <command name> - provides detailed help for a specific command
  • p4 help <命令名称> - 提供特定命令的详细帮助

#3


2  

http://www.perforce.com/perforce/doc.062/manuals/boilerplates/quickstart.html

Deleting files

To delete files from both the Perforce server and your workspace, issue the p4 delete command. For example:

要从Perforce服务器和工作区中删除文件,请发出p4 delete命令。例如:

p4 delete demo.txt readme.txt

The specified files are removed from your workspace and marked for deletion from the server. If you decide you don't want to delete the files after all, issue the p4 revert command. When you revert files opened for delete, Perforce restores them to your workspace.

指定的文件将从工作区中删除,并标记为从服务器中删除。如果您决定不想删除文件,请发出p4 revert命令。当您还原为删除而打开的文件时,Perforce会将它们还原到您的工作区。

#4


0  

Admitted - it takes a (small) number of steps to find the (excellent!) Perforce user guide online in the version that matches your installation and get to the chapter with the information you need.

已承认 - 在与您的安装相匹配的版本中,需要(少量)步骤才能在线查找(优秀!)Perforce用户指南,并获取所需信息的章节。

Whenever I find myself in need of anything about the p4 command line client, I rely on the help Perforce have built into it. Accessing it could not be easier:

每当我发现自己需要关于p4命令行客户端的任何内容时,我都依赖于Perforce内置的帮助。访问它并非易事:

  1. on the command line, enter p4
  2. 在命令行上,输入p4

This gets you to the information Michael Burr has shown in his answer (and some more). If you do not get a help screen right away, something is wrong with our client configuration, e.g. P4PORT is not set properly. You obviously need to fix that first.

这将让您了解Michael Burr在他的回答中所展示的信息(以及更多信息)。如果您没有立即获得帮助屏幕,我们的客户端配置出现问题,例如: P4PORT设置不正确。你显然需要先修复它。