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>.gitignore</literal>
\r
51 file directly. That allows you to specify more general
\r
52 patterns using filename globbing, described in the section below.
\r
53 Read <xref linkend="gitignore(5)"/> for more information.
\r
54 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
59 <title>The Global Ignore List</title>
\r
61 Another way to ignore files is to add them to the
\r
62 <firstterm>global ignore list</firstterm>. The big difference here
\r
63 is that the global ignore list is a client property.
\r
64 It applies to <emphasis>all</emphasis> Git projects, but on
\r
65 the client PC only. In general it is better to use the
\r
66 <filename>svn:ignore</filename> property where possible, because it
\r
67 can be applied to specific project areas, and it works for
\r
68 everyone who checks out the project. Read
\r
69 <xref linkend="tsvn-dug-settings-main"/> for more information.
\r
75 <title>Ignoring Versioned Items</title>
\r
77 Versioned files and folders can never be ignored - that's a feature
\r
78 of Git. If you versioned a file by mistake, read
\r
79 <xref linkend="tsvn-howto-unversion"/> for instructions on how to
\r
80 <quote>unversion</quote> it.
\r
84 <sect2 id="tsvn-dug-ignore-glob">
\r
85 <title>Pattern Matching in Ignore Lists</title>
\r
87 <primary>globbing</primary>
\r
90 <primary>pattern matching</primary>
\r
93 Git's ignore patterns make use of filename globbing,
\r
94 a technique originally used in Unix to specify files using
\r
95 meta-characters as wildcards. The following characters have
\r
102 Matches any string of characters, including
\r
103 the empty string (no characters).
\r
111 Matches any single character.
\r
119 Matches any one of the characters enclosed in the
\r
120 square brackets. Within the brackets, a pair of
\r
121 characters separated by <quote>-</quote>
\r
122 matches any character lexically between the two.
\r
123 For example <literal>[AGm-p]</literal> matches
\r
124 any one of <literal>A</literal>, <literal>G</literal>,
\r
125 <literal>m</literal>, <literal>n</literal>,
\r
126 <literal>o</literal> or <literal>p</literal>.
\r
133 Pattern matching is case sensitive, which can cause problems
\r
134 on Windows. You can force case insensitivity the hard way
\r
135 by pairing characters, eg. to ignore <literal>*.tmp</literal>
\r
136 regardless of case, you could use a pattern like
\r
137 <literal>*.[Tt][Mm][Pp]</literal>.
\r
141 If you want an official definition for globbing, you can find
\r
142 it in the IEEE specifications for the shell command language
\r
143 <ulink url="http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13">
\r
144 <citetitle>Pattern Matching Notation</citetitle>
\r
149 <title>No Paths in Global Ignore List</title>
\r
151 You should not include path information in your pattern.
\r
152 The pattern matching is intended to be used against plain
\r
153 file names and folder names.
\r
154 If you want to ignore all <literal>CVS</literal> folders,
\r
155 just add <literal>CVS</literal> to the ignore list. There is
\r
156 no need to specify <literal>CVS */CVS</literal> as you did in
\r
158 If you want to ignore all <literal>tmp</literal> folders
\r
159 when they exist within a <literal>prog</literal> folder but
\r
160 not within a <literal>doc</literal> folder you should use the
\r
161 <literal>svn:ignore</literal> property instead. There is no
\r
162 reliable way to achieve this using global ignore patterns.
\r