Perforce (P4):是否有“反向同步”之类的东西,可以将本地目录中的任何/所有更改推送到服务器?
我知道这是一个奇怪的问题,但是是否有一个 p4 命令与“sync”相反?也就是说,我希望将本地工作区目录中的所有文件推送到仓库。
我知道您的第一个想法可能是“但是为什么?”,答案是,这很复杂。
I know this is a strange question, but is there a p4 command that is the reverse of 'sync'? That is, I'd like whatever files are in my local workspace directory to be pushed to the depot.
I know your first thought is probably "but WHY?", and the answer is, it's complicated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
协调离线工作可以帮助您。它推送添加、更改或删除的文件。重命名的文件有点棘手。
出于好奇。到底什么是“很复杂”
Reconciling offline work could help you. It pushes files that are added, or changed or deleted . Its a bit trickier with renamed files.
Out of curiosity. What exactly is "it's complicated"
“提交”和“搁置”都可以将文件内容从本地工作区发送到仓库。
无论哪种情况,您都必须先使用“添加”或“编辑”来标记要发送到软件仓库的文件。 (如何执行此操作取决于您使用的客户端工具。)
Both 'submit' and 'shelve' can send file content from your local workspace to the depot.
In either case, you have to use 'add' or 'edit' first to mark the files to be sent to the depot. (How you do this depends on the client tool you're using.)
这是一个来自 O'Reilly Perforce 书的脚本,
您可能想从它开始
,它使 perforce 认为它已同步到当前头,但事实上
不对文件系统进行任何更改。因此,以下差异的行为(强制)类似于当前头部的更改。
我没有单独测试上述内容(它来自已广泛使用的较长脚本),但我相信它应该有效。
Here's a script, derived from the O'Reilly Perforce book
You probably want to start with
which makes perforce think it has synchronized to the current head, but in fact
makes no changes to the filesystem. So the below diffs will behave (to perforce) like changes to the current head.
I have not tested the above in isolation (it came from a longer script that has been widely used) but I believe it should work.