2011-02-11 4 views
11

나는 Mercurial을 사용하는 법을 배우고 있으며 그 학습 곡선은 매우 직선적이다. 하지만 내 문제 중 하나는 Mercurial 폴더에 .hgignore 파일을 추가 할 수 없다는 것입니다. 내가 만들 수 있습니다 /이 파일을 추가하는 방법Mercurial 폴더에 .hgignore를 추가하는 방법은 무엇입니까?

the system cannot find the specified file.

: 나는 명령

hg add .hgignore

을 실행할 때 윈도우 (7)는 오류를 반환, 내가이 작업을 수행 할 수 있도록하고,하지 않는 이유는 무엇입니까?

+1

[TortoiseHg] (http://tortoisehg.bitbucket.org/)은 저장소를 만들 때 자동으로 추가합니다. –

답변

15

touch .hgignore

또는

echo "" > .hgignore

필요한 디렉토리에 실행 명령 줄에서 만들기

,536,
8

것은

echo syntax: glob > .hgignore 
2

Mercurial 디렉토리에 추가 할 필요가 없습니다. 저장소의 루트 디렉토리에 .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.

을 그리고 거기 당신은 파일 mercurial.ini (또는 hgrc)에서 파일을 무시 정의하는 지침을 볼 수 있습니다 :

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

또한 글로벌 .hgignore 파일을 설정할 수 있습니다

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

나는 "Mercurial folder"가 내 소스 코드의 .hg 폴더라는 것을 언급하지 않았다. – Vimvq1987

+2

나는 그것을 이해했다. .hgignore를 .hg 폴더에 두지 말고 저장소 루트 폴더에 저장해야합니다. 즉, 소스 코드가있는 폴더와 동일한 폴더에 저장해야합니다. –

+0

당신의 요점을 알아보십시오. 나는 그것을 알지 못했다. 고마워요 :) – Vimvq1987

관련 문제