如果 Mercurial 中有任何本地更改(否则有其他更改),如何合并本地更改?
我的存储库中有两个头。我有五个在本地编辑过的文件。 Bitbucket 存储库有 15 个我尚未编辑的已更改文件,但它也包含相同 5 个文件的已更改版本。
我想要执行以下操作:
1) 如果我编辑了一个文件并且 Bitbucket 存储库包含相同的编辑文件,我希望优先考虑我的更改。
2) 如果我还没有编辑过文件,我想更新到最新版本。
Mercurial 中的什么命令序列可以让我执行此操作?我必须使用外部程序吗?
There are two heads on my repository. I have five files that I've edited locally. The Bitbucket repo has 15 changed files that I haven't edited, but it also contains changed versions of the same 5 files.
I'd like to do the following:
1) If I've edited a file and the Bitbucket repo contains the same edited file, I'd like my changes to take preference.
2) If I haven't edited a file, I'd like to update to the latest version.
What sequence of commands in Mercurial will let me do this? Do I have to use an external program?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
WITH LOCAL COMMITS
另请参阅
hg help merge-tools
WITHOUT LOCAL COMMITS
hg status -qn
为您提供以下列表您更改过的文件。由于只有五个文件,我会手动将它们复制走,然后恢复、拉取、更新并将它们复制回原位。在 unix 上,您可以编写一个一次性的 shell 脚本,类似于这样:这是未经测试的代码。运行它需要您自担风险。吃松饼并快乐。
WITH LOCAL COMMITS
See also
hg help merge-tools
WITHOUT LOCAL COMMITS
hg status -qn
gives you a list of files you have changed. Since it's only five files, I'd copy them away manually, then revert, pull, update and copy them back into place. On unix you could write a throw-away shell script, something that goes kinda' like this:This is untested code. Run it at your own risk. Eat muffins and be happy.
只需执行
此操作将从 bitbucket 中提取最新更改,并允许您按照您想要的方式合并本地更改。
这确实是一个基本功能,您应该阅读一些有关 Mercurial 的文档,例如评论中所说的 HG Init 。
just do
This will pull the latest changes from bitbucket and allow you to merge your local changes the way you want.
This is really a basic functionality, you should read some documentation about mercurial, for example HG Init like said in the comments.