Mercurial新手感到困惑

时间:2011-02-10 12:17:53

标签: mercurial

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

这是我(我想)我做过的事情:

- 在bitbucket.org上处理了一个中央存储库

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

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

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

现在我注意到每台计算机中的某些文件不在bitbucket存储库中,因此只在本地存储库中。没有任何拉动和推动似乎进入bitbucket存储库。

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

1 个答案:

答案 0 :(得分:2)

他们是否进入了您的本地存储库?我怀疑没有,即它们是未添加到提交中的新文件。在提交之前使用hg add将它们添加到变更集中,或者对于您正在使用的任何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:The Definitive Guide (a.k.a。hg“红皮书”):

http://hgbook.red-bean.com/read/mercurial-in-daily-use.html

  

告诉Mercurial要跟踪的文件

     

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

     

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

$ 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
相关问题