Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mercurial 反复无常的新手困惑了_Mercurial - Fatal编程技术网

Mercurial 反复无常的新手困惑了

Mercurial 反复无常的新手困惑了,mercurial,Mercurial,我对TFS和Vault很熟悉,但刚开始使用Mercurial,我似乎陷入了一片混乱 以下是我(认为)我所做的: -在bitbucket.org上创建了一个中央存储库 -在我的桌面PC上,从bitbucket克隆存储库,添加文件,提交文件,将文件推送到bitbucket -在我的笔记本电脑上,从bitbucket克隆存储库,提取文件,添加更多文件,提交它们,将它们推送到bitbucket 我继续在不同的计算机上添加、编辑等 现在我注意到,来自每台计算机的一些文件不在bitbucket存储库中,因此

我对TFS和Vault很熟悉,但刚开始使用Mercurial,我似乎陷入了一片混乱

以下是我(认为)我所做的:

-在bitbucket.org上创建了一个中央存储库

-在我的桌面PC上,从bitbucket克隆存储库,添加文件,提交文件,将文件推送到bitbucket

-在我的笔记本电脑上,从bitbucket克隆存储库,提取文件,添加更多文件,提交它们,将它们推送到bitbucket

我继续在不同的计算机上添加、编辑等

现在我注意到,来自每台计算机的一些文件不在bitbucket存储库中,因此只在本地存储库中。再多的推拉似乎也无法将其放入bitbucket存储库

我最可能做错的事情是什么?
有没有办法通过对bitbucket存储库的更改来“强制”执行这些更改?

它们是否进入了您的本地存储库?我怀疑不是,即它们是未添加到提交中的新文件。使用
hgadd
在提交之前将它们添加到变更集中,或者对于您正在使用的mercurial接口,使用任何等效项

编辑:

以下是Mercurial的帮助:

C:\Users\Bert>hg add --help
hg add [OPTION]... [FILE]...

add the specified files on the next commit

    Schedule files to be version controlled and added to the repository.

    The files will be added to the repository at the next commit. To undo an
    add before that, see "hg forget".

    If no names are given, add all files to the repository.
...
有关更多信息,请参见《Mercurial:权威指南》(又称hg“红皮书”):

告诉Mercurial要跟踪哪些文件

Mercurial不会处理存储库中的文件,除非您让它管理它们。hg status命令将告诉您Mercurial不知道哪些文件;它使用“?”来显示这些文件

要让Mercurial跟踪文件,请使用
hg add
命令。添加文件后,该文件的hg status输出中的条目将从“?”更改为“a”


显示
hg out
hg st
results存储库在bitbucket上是公共的吗?如果是的话,你能把你的本地克隆压缩到某个地方吗?“使用hg add将它们添加到变更集中”-这样说有点不正确。@zerkms-请告诉Meen,即使添加了文件,也不意味着它将提交到变更集中,因为
hg ci
可以接受要提交(或排除)的文件列表。事实上,讨论这件事并不重要,但我相信新手了解这些事情会有好处。我认为我使用的软件中一定有一个bug:VisualHG with VisualStudio2010。当我转到命令行时,一切似乎都正常工作。
$ hg init add-example
$ cd add-example
$ echo a > myfile.txt
$ hg status
? myfile.txt
$ hg add myfile.txt
$ hg status
A myfile.txt
$ hg commit -m 'Added one file'
$ hg status

use "hg -v help add" to show global options