perforce 中是否有相当于 git stash 的东西?

发布于 2024-08-18 12:41:28 字数 110 浏览 2 评论 0原文

我已经尽我所能地挖掘了互联网,但由于缺乏我,我无法找到任何轻松地在本地强制存储或分支的方法。 我知道 perforce 的 git 包装器,但从我读到的有关它的所有内容来看,它确实看起来不太成熟或不太可靠。

I've dug through the interwebs all I can, and I can't for the lack of me find any way of easily stashing or branching locally with perforce.
I know of the git wrapper for perforce, but it really doesn't seem too well developed or reliable from everything I've read about it.

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

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

发布评论

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

评论(3

姜生凉生 2024-08-25 12:41:28

Perforce 2009.2 具有搁置和取消搁置功能,允许您将修改放在服务器上,而无需将其签入。
http://blog.perforce.com/blog/?p=1872

我认为它提供了您想要的功能?

如果您尚未使用 2009.2,还有 P4_Shelvep4tar 作为可能的替代方案。

Perforce 2009.2 has shelve and unshelve, that let you put modifications on the server, without checking them in.
http://blog.perforce.com/blog/?p=1872

I think that provides the sort of functionality you want?

If you aren't yet using 2009.2, there are also P4_Shelve and p4tar as possible alternatives.

穿越时光隧道 2024-08-25 12:41:28

关于分支,我怀疑你可以在 Perforce 中本地“分支”,也不能在本地存储。

  • Git 基于提交图(DAG - 有向非循环图),它只会显示提交的内容(树和blob)
  • Perforce 是一个 线性 VCS,基于选择规则的组合(它将根据本地选择规则组合要显示的内容)

关于分支:

  • Git 中的分支只是 < a href="https://git-scm.com/book/en/v2/Git-Internals-Git-References" rel="nofollow noreferrer">一个轻量级的本地别名到头部[ *] /提示提交。
  • Perforce 中的一个分支是:
    • 代码线(最有可能用作名词时的含义)
    • 分支视图规范(如在“p4分支”命令创建的实体中 - 也是一个名词) - 这些将在下面讨论
    • 用作动词(“分支”)时,表示使用“p4integrate”命令创建一个或多个文件的新代码线(或分支!)

当用作动词(“分支”)时, ="http://www.vaccaperna.co.uk/scm/branching.html" rel="nofollow noreferrer">perforce 分支简介,Perforce 与其中央 depo 紧密相连,需要创建用于创建分支的每个文件的相关元数据。
Git 只会写入一些位来注册新分支的创建!

[*] git 分支存储在 .git/refs/heads/ 子目录中

Regarding branching, I doubt you can "branch" locally in Perforce, nor could you natively stash.

  • Git is based on a graph of commits (a DAG - Directed Acyclic Graph actually), which will display only the content of a commit (trees and blobs)
  • Perforce is a linear VCS, based on composition of selection rules (it will compose what to display based on local selection rules)

Regarding branching:

  • A branch in Git is just a light-weight and local alias to a head[*] / tip commit.
  • A branch in Perforce is:
    • a codeline (most likely meaning when used as a noun)
    • a branch view specification (as in the entity created by "p4 branch" command - also a noun) - these are talked about below
    • when used as a verb ("to branch") it means to use the "p4 integrate" command to create a new codeline (or branch!) of one or more files

As mentioned in this introduction to perforce branching, Perforce, being heavily linked to its central depo, need to create the relevant metadata for each files to create a branch.
Git would only write some bits to register the creation of a new branch!

[*] git branches are stored in the .git/refs/heads/ subdirectory

禾厶谷欠 2024-08-25 12:41:28

Perforce 的未来版本将拥有私有本地分支。 P4Sandbox 将允许您拥有一个本地的、断开连接的仓库子集。您可以从中央服务器拉取,在沙箱中做任何您想做的事情(包括分支和集成),然后,如果您愿意,可以推回到中央服务器。

正如 Douglas Leeder 的回答中所解释的,搁置是与 git stash 最接近的等效项。

(虽然最初看起来 P4Sandbox 将在 2011.1 版本中首次亮相,但 2011.1 测试版没有该功能,我在该版本的文档中也找不到任何提及它的信息。 perforce.com/blog/?p=6000#comment-4261" rel="nofollow">截至 2011 年 8 月,P4Sandbox 测试版定于“今年秋季”推出。)

A future version of Perforce will have private local branching. P4Sandbox will allow you to have a local, disconnected subset of the depot. You can pull from the central server, do whatever you want in your sandbox (including branching and integrating) and then, if you wish, push back to the central server.

Shelving is the closest equivalent of git stash, as explained in Douglas Leeder's answer.

(Although it initially appeared that P4Sandbox would make its debut in version 2011.1, the 2011.1 beta does not have the feature, nor can I find any mention of it in the documentation for that version. As of August 2011, the P4Sandbox beta was slated for "this fall".)

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