2011-02-11 2 views
11

मैं Mercurial का उपयोग करना सीख रहा हूं, और इसकी सीखने की अवस्था बहुत सरल है। लेकिन मेरी समस्या में से एक है, मैं .hgignore फ़ाइल को Mercurial फ़ोल्डर में नहीं जोड़ सकता। विंडोज (7) मुझे ऐसा करने की अनुमति नहीं है, और जब मैं आदेशमेरे Mercurial फ़ोल्डर में .hgignore जोड़ने के लिए कैसे?

hg add .hgignore

चलाने के लिए, यह त्रुटि देता है:

the system cannot find the specified file.

मैं कैसे बना सकते हैं/इस फ़ाइल को जोड़ सकता हूँ?

+1

[TortoiseHg] (http://tortoisehg.bitbucket.org/) एक भंडार बनाते समय इसे स्वचालित रूप से जोड़ता है। –

उत्तर

15

निष्पादित

touch .hgignore

या

echo "" > .hgignore

जरूरत निर्देशिका में

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 फ़ोल्डर" मेरे स्रोत कोड – Vimvq1987

+2

में .hg फ़ोल्डर है, मुझे समझ में आया। मैं कहता हूं कि .hgignore को .hg फ़ोल्डर में नहीं रखा जाना चाहिए, इसे भंडार रूट फ़ोल्डर में रखा जाना चाहिए, यानी इसे उसी फ़ोल्डर में रखा जाना चाहिए जहां आपका स्रोत कोड है। –

+0

अपना अंक प्राप्त करें। मुझे यह नहीं पता था। धन्यवाद :) – Vimvq1987