1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">
\r
3 <sect1 id="tsvn-dug-ignore">
\r
4 <title>Ignoring Files And Directories</title>
\r
6 <primary>ignore</primary>
\r
9 <primary>unversioned files/folders</primary>
\r
11 <?dbhh topicname="HIDD_IGNORE"?>
\r
13 <figure id="tsvn-dug-ignoring-dia-1">
\r
14 <title>Explorer context menu for unversioned files</title>
\r
15 <graphic fileref="../images/ContextMenuFileIgnore.png"/>
\r
17 In most projects you will have files and folders that should not be subject
\r
18 to version control. These might include files created by the compiler,
\r
19 <filename>*.obj, *.lst</filename>, maybe an output folder used to store
\r
20 the executable. Whenever you commit changes, TortoiseGit shows your unversioned
\r
21 files, which fills up the file list in the commit dialog. Of course you
\r
22 can turn off this display, but then you might forget to add a new source
\r
26 The best way to avoid these problems is to add the derived files
\r
27 to the project's ignore list. That way they will never show up in
\r
28 the commit dialog, but genuine unversioned source files will still
\r
32 If you <action>right click</action> on a single unversioned file,
\r
33 and select the command
\r
35 <guimenu>TortoiseGit</guimenu>
\r
36 <guimenuitem>Add to Ignore List</guimenuitem>
\r
38 from the context menu, a submenu appears allowing you to select just that
\r
39 file, or all files with the same extension.
\r
40 If you select multiple files, there is no submenu and you can only add
\r
41 those specific files/folders.
\r
44 If you want to remove one or more items from the ignore list,
\r
45 <action>right click</action> on those items and select
\r
47 <guimenu>TortoiseGit</guimenu>
\r
48 <guimenuitem>Remove from Ignore List</guimenuitem>
\r
50 You can also access a folder's <literal>svn:ignore</literal>
\r
51 property directly. That allows you to specify more general
\r
52 patterns using filename globbing, described in the section below.
\r
53 Read <xref linkend="tsvn-dug-propertypage"/> for more information
\r
54 on setting properties directly. Please be aware that each ignore pattern
\r
55 has to be placed on a separate line. Separating them by spaces does not work.
\r
58 <title>The Global Ignore List</title>
\r
60 Another way to ignore files is to add them to the
\r
61 <firstterm>global ignore list</firstterm>. The big difference here
\r
62 is that the global ignore list is a client property.
\r
63 It applies to <emphasis>all</emphasis> Git projects, but on
\r
64 the client PC only. In general it is better to use the
\r
65 <filename>svn:ignore</filename> property where possible, because it
\r
66 can be applied to specific project areas, and it works for
\r
67 everyone who checks out the project. Read
\r
68 <xref linkend="tsvn-dug-settings-main"/> for more information.
\r
72 <title>Ignoring Versioned Items</title>
\r
74 Versioned files and folders can never be ignored - that's a feature
\r
75 of Git. If you versioned a file by mistake, read
\r
76 <xref linkend="tsvn-howto-unversion"/> for instructions on how to
\r
77 <quote>unversion</quote> it.
\r
80 <sect2 id="tsvn-dug-ignore-glob">
\r
81 <title>Pattern Matching in Ignore Lists</title>
\r
83 <primary>globbing</primary>
\r
86 <primary>pattern matching</primary>
\r
89 Git's ignore patterns make use of filename globbing,
\r
90 a technique originally used in Unix to specify files using
\r
91 meta-characters as wildcards. The following characters have
\r
98 Matches any string of characters, including
\r
99 the empty string (no characters).
\r
107 Matches any single character.
\r
115 Matches any one of the characters enclosed in the
\r
116 square brackets. Within the brackets, a pair of
\r
117 characters separated by <quote>-</quote>
\r
118 matches any character lexically between the two.
\r
119 For example <literal>[AGm-p]</literal> matches
\r
120 any one of <literal>A</literal>, <literal>G</literal>,
\r
121 <literal>m</literal>, <literal>n</literal>,
\r
122 <literal>o</literal> or <literal>p</literal>.
\r
129 Pattern matching is case sensitive, which can cause problems
\r
130 on Windows. You can force case insensitivity the hard way
\r
131 by pairing characters, eg. to ignore <literal>*.tmp</literal>
\r
132 regardless of case, you could use a pattern like
\r
133 <literal>*.[Tt][Mm][Pp]</literal>.
\r
136 If you want an official definition for globbing, you can find
\r
137 it in the IEEE specifications for the shell command language
\r
138 <ulink url="http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13">
\r
139 <citetitle>Pattern Matching Notation</citetitle>
\r
143 <title>No Paths in Global Ignore List</title>
\r
145 You should not include path information in your pattern.
\r
146 The pattern matching is intended to be used against plain
\r
147 file names and folder names.
\r
148 If you want to ignore all <literal>CVS</literal> folders,
\r
149 just add <literal>CVS</literal> to the ignore list. There is
\r
150 no need to specify <literal>CVS */CVS</literal> as you did in
\r
152 If you want to ignore all <literal>tmp</literal> folders
\r
153 when they exist within a <literal>prog</literal> folder but
\r
154 not within a <literal>doc</literal> folder you should use the
\r
155 <literal>svn:ignore</literal> property instead. There is no
\r
156 reliable way to achieve this using global ignore patterns.
\r