从 Mercurial 存储库中删除目录
我刚刚第一次推送到 Mercurial 存储库,现在我正在尝试查看是否可以从存储库中删除目录。我从本地文件系统中删除了该目录,并在 Ubuntu 中尝试了此命令
sudo hg push https://alex.genadinik:[email protected]/hg/ "some comment"
: 我得到了以下错误:
hg push: invalid arguments
但这是我最初用来推送的命令。我在这里做错了什么?
这是我尝试过的:
$ sudo hg commit -m "removing file"
$ sudo hg push
abort: repository default-push not found!
为什么会发生这种情况?
I just made my first push into a Mercurial repository and now I am trying to see if I can delete a directory from the repository. I deleted that directory from my local file system and tried this command from Ubuntu:
sudo hg push https://alex.genadinik:[email protected]/hg/ "some comment"
and I got the error that:
hg push: invalid arguments
But that was the command I used to originally push. What did I do wrong here?
Here is what I tried:
$ sudo hg commit -m "removing file"
$ sudo hg push
abort: repository default-push not found!
Why would that happen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该遵循的流程是:
hg 删除
或hg 忘记
文件。 Mercurial 不跟踪目录,因此如果您删除特定目录中的所有文件,从 Mercurial 的角度来看,该目录本身将不复存在。最后,一旦文件被跟踪,您就无法使用标准
rm
或del
命令将其删除,也无法从文件浏览器中将其删除。这样做会导致 Mercurial 将文件标记为“丢失”,这意味着它仍在被跟踪。完成此操作后,您可以运行
hg status
,它应该显示您刚刚删除的所有带有R
前缀的文件。提交删除。与任何其他修改一样,hg remove/forget 是需要在推送之前提交的更改。
the process you should follow is:
hg remove
orhg forget
the files. Mercurial does not track directories, so if you delete all files from a particular directory, the directory itself will cease to exist from a Mercurial standpoint.Finally, once a file is tracked, you cannot remove it with a standard
rm
ordel
command, nor can you remove it from a file browser. Doing this will cause Mercurial to mark the file as 'missing', which means it's still being tracked.Once this is done, you can run an
hg status
and it should show all the files you just removed with anR
prefix.commit the deletion. Like any other modification, the hg remove/forget is a change that needs to be committed before it can be pushed.
需要指定存储库吗?你不能只使用“hg Push”吗?除非这不是您最初克隆的存储库?通常你也想在提交中发表评论,但不确定,但我认为你不能在推送中发表评论。 'hg commit -m "my comments"'
另外,请确保在推送之前已提交更改。
因此,就您而言,我认为这是克隆初始存储库后您应该做的事情。
它会提示您输入凭据。
Do you need to specify the repository? Can't you just use 'hg push'? Unless this isn't the repository you initially cloned from? Usually you want to make your comments in the commit as well, not for sure, but I don't think you can in a push. 'hg commit -m "my comments"'
Also, ensure you have committed your changes before you push.
So in your case I would see this as what you should do once you have cloned your initial repository.
It will prompt you for credentials.
Push 命令不接受注释参数。你记错了你做了什么。您可能做了一次提交(可以使用 -m 接受注释),然后推送,这接受 URL 但不接受注释。该错误告诉您删除该评论。
The push command doesn't take a comment argument. You're misremembering what you did. You probably did a commit (which can take a comment with -m) and then push, which takes a URL but not a comment. The error is telling you to get rid of that comment.