从 Perforce 恢复已删除的文件

发布于 2024-12-26 10:34:05 字数 239 浏览 0 评论 0原文

上个月我从 Perforce 中删除了一个文件。有办法从 P4 中检索它吗?

如果可以,我可以使用什么命令?

注意:我不是 p4 的管理员。我不希望该文件返回到 P4,但我只想将其保留在我的本地工作区中。

另外,我不知道上个月删除它的确切时间范围......我可以运行什么命令?

我在 Windows 上运行 P4。如果有人能为 Windows 提供等效的命令,我将不胜感激

,谢谢!

I deleted a file from Perforce in the last month. Is there a way to retrieve it from P4?

If so, what command can I use?

Note: I'm not the admin for p4. And I don't want the file back in P4 but I just want it in my local workspace.

Also, I don't know the exact timeframe when I deleted it in last month...What command can I run?

I'm running P4 on windows. I'll appreciate if someone can provide equivalent command for windows

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

尾戒 2025-01-02 10:34:05

当您在 Perforce 中删除文件时,它会创建一个“已删除”修订版,但存档文件仍然存在。

在 Depot 视图中的 Perforce P4V GUI 中,浏览窗格顶部有一个过滤器符号 Yellow Flag

单击此按钮并选择“显示已删除的仓库文件”。

找到您要恢复的文件并右键单击它。选择“回滚...”并将其恢复到该文件的上一个版本(在删除之前)。

默认情况下,它将创建一个新的更改列表,如果您已经有一个更改列表,请务必选择您想要的更改列表。

在命令行上:
p4 同步 //depot/folder/subfolder/filename@changelist

When you delete a file in Perforce, it creates a "deleted" revision, but the archive file is still there.

In the Perforce P4V GUI in the depot veiw, there is a filter symbol on top of the explore pane Yellow Flag.

Click on this and select "Show Deleted Depot Files".

Find the file you want to restore and right-click on it. Select "Rollback..." and revert it to the previous revision of that file (before it was deleted.)

By default it will create a new changelist, be sure to select the one you want if you already have one.

On the command line:
p4 sync //depot/folder/subfolder/filename@changelist

梦纸 2025-01-02 10:34:05

您可以使用命令行或 GUI,从命令行 p4sync -f 强制重新同步文件。有关更多信息,请参阅 Perforce 知识库

You can use either the command line or the GUI, from the command line p4 sync -f forces the files to be resynchronized. For more information see the Perforce Knowledge Base.

尘世孤行 2025-01-02 10:34:05

如果您尚未将已删除文件的更改列表提交到存储库,请右键单击 p4v 中包含已删除文件的文件夹,然后选择获取修订。请务必选中强制操作,然后单击获取修订。然后删除的文件将从p4服务器恢复。

参考:https://forums.perforce.com/index.php?/topic/1479-how-to-restore-files-deleted-in-p4c-workspace/#entry4726

If you haven't committed the change list of deleted files to the repository, right click on the folder containing the deleted files in p4v and choose Get Revision. Be sure to check Force Operation and then Click Get Revision. Then the deleted files will be restored from p4 server.

ref: https://forums.perforce.com/index.php?/topic/1479-how-to-restore-files-deleted-in-p4c-workspace/#entry4726

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文