当我完成完全重写后使用 Mercurial

发布于 2024-10-08 20:19:00 字数 295 浏览 0 评论 0原文

这是我的存储库:

https://bitbucket.org/sergiotapia/sharpdic

基本上,我重写了整个图书馆。它根本不像原来的那样。我可以运行什么命令来完全删除/忽略现有的代码库并将其替换为新的代码版本?

我已经对本地光盘上的文件夹执行了 hg init(它具有较新的代码),我是否必须在尝试上传之前将其删除?

谢谢。

This is my repository:

https://bitbucket.org/sergiotapia/sharpdic

Basically, I've rewritten the entire library. It doesn't resemble the original at all. What command can I run to completely erase/neglect the existing code base and replace it with my newer code version?

I've done an hg init on the folder on my local disc (it has the newer code), do I have to delete that before trying to upload?

Thanks.

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

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

发布评论

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

评论(1

秋日私语 2024-10-15 20:19:00

只需转到修订版 0 (hg up null),提交(创建一个新分支),然后关闭旧分支。如果不完全替换存储库,这就是我要做的。

我假设您的新文件当前尚未位于存储库目录中。先做好备份!

hg up tip -C
hg commit -m 'Old code branch' --close-branch
hg up null -C

现在,您将拥有一个空的存储库目录,从版本 0 开始。将新文件复制到其中(不要从新文件目录复制 .hg 文件夹)。

hg addremove
hg commit -m 'New code branch'

那应该可以解决问题。我有没有提到先备份文件和存储库? ;-)

另一种选择是强制将新存储库推送到远程存储库,但在执行此操作后您仍然需要关闭旧分支,以便只有一个活动头。如果您确实已提交到 nbew 存储库,请选择此选项(您只提到已完成初始化,所以我假设尚未提交)。

Just go to revision 0 (hg up null), commit (creates a new branch), and then close the old branch. That's what I would do if not replacing the repo altogether.

I assume that your new files are currently not yet in the repo directory. Make a backup first!

hg up tip -C
hg commit -m 'Old code branch' --close-branch
hg up null -C

You'll now have an empty reporsitory directoy, starting at revision 0. Copy your new files into it (don't copy the .hg folder from the new file directory).

hg addremove
hg commit -m 'New code branch'

That should do the trick. Did I mention to backup the files and repo first? ;-)

Another option is to force a push of the new repo onto the remote repo, but you'll still need to close the old branch after doing this in order to have only one active head. Choose this option if you did commit already to the nbew repo (you only mentionned having done a init, so I assumed no commit yet).

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