统一DVCS命令

编程入门 行业动态 更新时间:2024-10-26 20:26:33
本文介绍了统一DVCS命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在处理多个(开源)项目时,多个版本控制系统开始出现问题。虽然他们共享共同的操作,但我经常通过键入 hg add 而不是添加。我记得看到项目,通过在shell中提供基本的命令 commit / ci add 等,可以统一访问不同的源代码控制软件。根据存储库,它会依次调用 hg add 或 git add 等。

我已经看过Amp: amp.carboni.ca/ (这似乎是关闭ATM)任何其他脚本就像那样?

解决方案

我认为两个版本控制系统(在这种情况下完全不同)版本控制系统的统一一个明智的尝试。尽管有一些共同之处,但它们之间的差异远大于共同点。更具体地说,虽然可以将某个系统的某些命令映射到另一个系统中的类似命令,但仍然存在语义差异,因为Mercurial和Git拥有完全不同的内部模型。只要考虑如何表示分支或git的分段区域。

不要试图在用户 级别上,我认为坚持使用一个版本控制系统是更加可取的,并且如果需要的话,使用桥接器(类似于git-svn)将您的更改/历史记录回送到另一个系统。

输入 hg add 与 git add 并不是真正危险的东西,如果您目前目录不是在两个系统中管理的存储库,因此您将收到一条有意义的错误消息。

When working on multiple (open source) projects, multiple version controll systems start to be problematic. While they share common operations, I often make mistakes by typing hg add instead git add.

I remember seeing project some time ago that made access to different source control software in uniform way by providing basic commands commit/ci add etc. in shell. Depending on repository it would in turn call hg add or git add etc.

I've seen Amp: amp.carboni.ca/ (which seems to be down ATM) any other scripts like that?

解决方案

I think unifications of two (in this case completely different) version control systems is not a sensible thing to attempt. While there are certain commonalities, the differences far outweigh the commonalities. More specifically, while you could map certain commands from one system to a similar command in another system, there will still be semantic differences because Mercurial and Git have completely different internal models. Just consider how branching is represented or git's staging area.

Instead of trying to unify both systems at the "user" level, I think it is much more desirable to stick with one version control system and, if required, backport your changes/history to another system using a bridge (similar to git-svn).

Typing hg add vs. git add is not something that can get really dangerous if your current directory is not a repository managed in both systems, so you'll get a meaningful error message.

更多推荐

统一DVCS命令

本文发布于:2023-06-10 18:32:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/616431.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令   DVCS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!