当我完成完全重写后使用 Mercurial
这是我的存储库:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需转到修订版 0 (
hg up null
),提交(创建一个新分支),然后关闭旧分支。如果不完全替换存储库,这就是我要做的。我假设您的新文件当前尚未位于存储库目录中。先做好备份!
现在,您将拥有一个空的存储库目录,从版本 0 开始。将新文件复制到其中(不要从新文件目录复制
.hg
文件夹)。那应该可以解决问题。我有没有提到先备份文件和存储库? ;-)
另一种选择是强制将新存储库推送到远程存储库,但在执行此操作后您仍然需要关闭旧分支,以便只有一个活动头。如果您确实已提交到 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!
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).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).