复制带有未提交更改的 Mercurial 存储库

发布于 2024-10-16 23:57:45 字数 198 浏览 2 评论 0原文

我有一个 Mercurial 存储库 bitbucket.org 和我的 wokstation 上的克隆。克隆中有一些未提交(未钓鱼)的工作。我必须将这些克隆复制到我的笔记本电脑上,因为我将出差一两周并想做一些工作。

是否有一种简单且节省的方法可以将存储库及其未提交的更改复制到另一个设备?我知道我可以将存储库从工作站克隆到我的笔记本电脑,但这不会复制未提交的工作。

I have an mercurial repositry a bitbucket.org and a clone on my wokstation. The clone has some uncommited (unfished) work in it. I have to copy these clone to my laptop because I will be on a trip for one or two weeks and want to do some work.

Is there a simple and save way to copy the repository with its uncommited changes to another device? I knew I could clone the repo from the workstation to my laptop but this won't copy uncommited work.

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

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

发布评论

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

评论(3

讽刺将军 2024-10-23 23:57:45

只需复制整个存储库的文件夹即可。

Simply copy the entire repository's folder.

樱花细雨 2024-10-23 23:57:45

只需提交该工作即可。需要完成才能提交的工作是遗留下来的 CVS/SVN 思维。提交它,然后更新到它的父级并处理您想要处理的任何其他事情。当工作最终完成时,您将推送一个变更组而不是单个变更集,因此没有人会在这些间隙变更集的末尾有反编译阶段。

避免在 Mercurial 中提交工作(使用书架、阁楼、复制存储库等)是丢失工作的唯一方法——避免它。

Just commit that work. That work needs to be finished to be committed is left-over CVS/SVN thinking. Commit it, and then update to its parent and work on whatever else you want to work on. When eventually the work is done you're pushing a changegroup not individual changesets, so no one will have the uncompiling stage at the end of those interstitial changesets on them.

Avoiding committing work in Mercurial (using shelve, attic, copying repos, etc.) is the only way to lose work -- avoid it.

放赐 2024-10-23 23:57:45

我更喜欢我的第一个答案(提交它),但如果您确实无法让自己提交未完成的工作,那么您应该使用 Mercurial 队列以及位于其自己存储库中的补丁队列。这很容易完成:

hg qinit --create-repo

然后使用以下命令将未提交的更改作为补丁导入:

hg qnew --force name-for-this-work

然后您可以:

hg qcommit -m "work in progress"

然后您可以qclone 该存储库并获取正在进行的工作及其覆盖的基础存储库。更多详细信息请参阅Mercurial 书中有关队列的章节。

但实际上,永远没有充分的理由让不投入的工作超过一两个小时。

I prefer my first answer (commit it) but if you positively can't bring yourself to commit unfinished work then you should be using Mercurial Queues with a patch queue that lives in its own repository. This is easily done with:

hg qinit --create-repo

Then you import your uncomitted changes as a patch using:

hg qnew --force name-for-this-work

then you can:

hg qcommit -m "work in progress"

Then you can qclone that repo and get both the work in progress and the base repository on which it's overlayed. More details are available in the Mercurial book's chapter on queues.

Really, though, there's just never a good reason to have uncommitted work for more than an hour or two.

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