在仍然推/拉的同时,如何在本地Mercury存储库中保留未提交的更改? [英] How to keep uncommitted changes in a local mercurial repository, while still pushing/pulling?

查看:81
本文介绍了在仍然推/拉的同时,如何在本地Mercury存储库中保留未提交的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我正在处理一些我不想提交的文件,那么我只保存它们.然后,我还有其他要推送到服务器的文件,但是,如果其他人对存储库进行了更改,然后将它们拉下来,它会要求我合并或重新设置基础..但是这些选项中的任何一个都会导致我丢失我尚未承诺的本地更改.

If i'm working on some files that I don't want to commit, I just save them. I then have other files I want to push to the server, however if someone else has made changes to the repository, and I pull them down, it asks me to merge or rebase.. but either of these options will cause me to lose my local changes that I have not committed.

其他人正在做些什么来解决这个问题?我发现很难找到有关扩展架的文档.

What are other people doing to get around this? I find the documentation for the shelving extension hard to get my head around.

注意:我正在使用Mercurial Eclipse将文件推入/拉出服务器.

Note: I'm using Mercurial Eclipse to push and pull files to/from the server.

任何对此的解释将不胜感激!谢谢!

Any explanation of this would be greatly appreciated! Thanks!

示例:

我正在Mercurial Eclipse中的网站上工作.我有一个新文件夹和新文件,现在还不想提交到服务器.我还修改了一些现有文件,但现在还不想更改.

I'm working on my website in Mercurial Eclipse. I have a new folder and new files that I don't want to commit to the server just yet. I've also modified some existing files and I don't want to make those changes live just yet.

然后我的网站上的某些内容损坏了,我需要对其进行修复,如果不进行基础调整或与最新的仓库回购合并,就无法修复它,这将导致我丢失所有未提交的更改.

Then something on my website breaks and I need to fix it, it won't let me fix it without rebasing or merging with the most recent tip of the repo and this will cause me to lose all my uncommitted changes.

如果我不想丢失新的文件夹和文件,我该怎么办?重新克隆似乎很乏味.将文件复制到新文件夹似乎也很乏味.我确定Shelving或MQ会做我想要的事情,我只是还不知道该怎么做.

What should I do with my new folder and files i've edited if I don't want to lose it? Re-cloning seems tedious. Copying the files to a new folder seems tedious as well. I'm sure Shelving or MQ will do what I want, I just don't know how to go about it yet.

推荐答案

我确信有人会帮助您找到一个不好的解决方法,但是最好的方法是更改​​目标-只需提交即可.尚未提交的代码尚未编写.如果您确实不能忍受历史记录中的频繁提交,则将Mercurial Queues与队列存储库一起使用并进行提交.然后,您可以弹出变更集,进行推/拉/合并,然后再将其推回去,您所有有价值的工作都将提交到补丁队列中.

I'm sure someone will help you find a bad workaround, but the best route is to change you goals -- just commit. Code that hasn't been committed hasn't been written. If you positively can't abide having frequent commits in your history use Mercurial Queues with a queue repository and commit that. You can then pop the changesets, push/pull/merge, and the push them back on, and all you valuable work will be committed in the patch queue.

这篇关于在仍然推/拉的同时,如何在本地Mercury存储库中保留未提交的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆