2011-02-11 16 views
11

Estoy aprendiendo a usar Mercurial, y su curva de aprendizaje es bastante sencilla. Pero uno de mis problemas es que no puedo agregar el archivo .hgignore a la carpeta Mercurial. Ventanas (7) no me permite hacer esto, y cuando funciono con el comando¿Cómo agregar .hgignore a mi carpeta de Mercurial?

hg add .hgignore

, devuelve error:

the system cannot find the specified file.

¿Cómo puedo crear/añadir este archivo?

+1

[TortoiseHg] (http://tortoisehg.bitbucket.org/) lo agrega automáticamente al crear un repositorio. –

Respuesta

15

Ejecutar

touch .hgignore

o

echo "" > .hgignore

en el directorio necesaria

8

Crear desde la línea de comandos

echo syntax: glob > .hgignore 
2

No necesita agregarlo al directorio de Mercurial. Debe colocar .hgignore en el directorio raíz del repositorio.

The Mercurial system uses a file called .hgignore in the root directory of a repository to control its behavior when it searches for files that it is not currently tracking

También puede configurar los archivos globales .hgignore:

In addition, a Mercurial configuration file can reference a set of per-user or global ignore files. See the hgrc(5) man page for details of how to configure these files. Look for the "ignore" entry in the "ui" section.

Y allí se puede ver instrucciones para definir archivo en mercurial.ini (o hgrc) ignorar archivo:

ignore A file to read per-user ignore patterns from. This file should be in the same format as a repository-wide .hgignore file. This option supports hook syntax, so if you want to specify multiple ignore files, you can do so by setting something like ignore.other = ~/.hgignore2. For details of the ignore file format, see the hgignore(5) man page.

+0

No mencioné que "carpeta Mercurial" es la carpeta .hg en mi código fuente – Vimvq1987

+2

Lo entendí. Digo que .hgignore no se debe colocar en la carpeta .hg, sino que se debe colocar en la carpeta raíz del repositorio, es decir, se debe colocar en la misma carpeta donde está el código fuente. –

+0

Obtenga su punto. No lo había sabido. Gracias :) – Vimvq1987

Cuestiones relacionadas