Log dialog can revert selected files to parent revision
[TortoiseGit.git] / doc / source / en / TortoiseGit / tsvn_dug / dug_ignore.xml
blob0fe72adfc3769f5d7c7d2e02185b88274abdb155
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
5         <indexterm>\r
6                 <primary>ignore</primary>\r
7         </indexterm>\r
8         <indexterm>\r
9                 <primary>unversioned files/folders</primary>\r
10         </indexterm>\r
11         <?dbhh topicname="HIDD_IGNORE"?>\r
12         <?dbhh topicname="HIDD_INPUTDLG"?>\r
13         <para>\r
14                 <figure id="tsvn-dug-ignoring-dia-1">\r
15                         <title>Explorer context menu for unversioned files</title>\r
16                         <graphic fileref="../images/ContextMenuFileIgnore.png"/>\r
17                 </figure>\r
18                 In most projects you will have files and folders that should not be subject\r
19                 to version control. These might include files created by the compiler,\r
20                 <filename>*.obj, *.lst</filename>, maybe an output folder used to store\r
21                 the executable, <filename>bin/, obj/</filename>. \r
22                 More examples include user-specific workspace settings <filename>*.suo, *.user</filename>(Visual Studio),\r
23                 backup files <filename>*.bak, Backup*/</filename>,\r
24                 Shell metadata files <filename>Thumbs.db, Desktop.ini, .DS_Store/</filename>.\r
25                 Whenever you commit changes, TortoiseGit shows your unversioned\r
26                 files, which fills up the file list in the commit dialog. Of course you\r
27                 can turn off this display, but then you might forget to add a new source\r
28                 file.\r
29         </para>\r
30         <para>\r
31                 The best way to avoid these problems is to add the derived files\r
32                 to the project's ignore list. That way they will never show up in\r
33                 the commit dialog, but genuine unversioned source files will still\r
34                 be flagged up.\r
35         </para>\r
36         <para>\r
37                 If you <action>right click</action> on one or more unversioned files,\r
38                 and select the command\r
39                 <menuchoice>\r
40                         <guimenu>TortoiseGit</guimenu>\r
41                         <guimenuitem>Add to Ignore List</guimenuitem>\r
42                 </menuchoice>\r
43                 from the context menu, a submenu appears allowing you to select ignore by names or by extensions.\r
44                 Ignore dialog shows that allows you to select ignore type and ignore file.\r
45                 <figure id="tsvn-dug-ignoring-dia-2">\r
46                         <title>Ignore dialog</title>\r
47                         <graphic fileref="../images/IgnoreDialog.png"/>\r
48                 </figure>\r
50                 Ignore Type\r
51                 <variablelist>\r
52                         <varlistentry>\r
53                                 <term>Ignore item(s) only in containing folder(s)</term>\r
54                                 <listitem>\r
55                                         <para>\r
56                                                 Only ignore the selected pattern(s) within that folder(s).\r
57                                         </para>\r
58                                 </listitem>\r
59                         </varlistentry>\r
60                         <varlistentry>\r
61                                 <term>Ignore item(s) recursively</term>\r
62                                 <listitem>\r
63                                         <para>\r
64                                                 Ignore items with the selected pattern(s) in that folder(s) and child folder(s).\r
65                                         </para>\r
66                                 </listitem>\r
67                         </varlistentry>\r
68                 </variablelist>\r
70                 Ignore File\r
71                 <variablelist>\r
72                         <varlistentry>\r
73                                 <term>.gitignore in the repository root</term>\r
74                                 <listitem>\r
75                                         <para>\r
76                                                 Write the ignore entries in .gitignore in the repository root.\r
77                                                 This allows you to synchronize the ignore list with remote repository.\r
78                                         </para>\r
79                                 </listitem>\r
80                         </varlistentry>\r
81                         <varlistentry>\r
82                                 <term>.gitignore in the containing directories of the items</term>\r
83                                 <listitem>\r
84                                         <para>\r
85                                                 Write the ignore entries in .gitignore in the containing directories of the items.\r
86                                                 This allows you to synchronize the ignore list with remote repository.\r
87                                         </para>\r
88                                 </listitem>\r
89                         </varlistentry>\r
90                         <varlistentry>\r
91                                 <term>.git/info/exclude</term>\r
92                                 <listitem>\r
93                                         <para>\r
94                                                 Write the ignore entries in .git/info/exclude in repository metadata.\r
95                                                 This allows you to store the ignore list locally, but cannot synchronize with remote repository.\r
96                                         </para>\r
97                                 </listitem>\r
98                         </varlistentry>\r
99                 </variablelist>\r
100         </para>\r
101         <para>\r
102                 If you want to remove one or more items from the ignore list,\r
103                 in current version of TortoiseGit, you have to manually edit the ignore list file using a text editor that can handle Unix EOL.\r
104                 That allows you to specify more general\r
105                 patterns using filename globbing, described in the section below.\r
106                 Read <xref linkend="gitignore(5)"/> for more information. \r
107     Please be aware that each ignore pattern \r
108                 has to be placed on a separate line. Separating them by spaces does not work.\r
109         </para>\r
110   <!--\r
111         <tip>\r
112                 <title>The Global Ignore List</title>\r
113                 <para>\r
114                         Another way to ignore files is to add them to the\r
115                         <firstterm>global ignore list</firstterm>. The big difference here\r
116                         is that the global ignore list is a client property.\r
117                         It applies to <emphasis>all</emphasis> Git projects, but on\r
118                         the client PC only. In general it is better to use the\r
119                         <filename>svn:ignore</filename> property where possible, because it\r
120                         can be applied to specific project areas, and it works for\r
121                         everyone who checks out the project. Read\r
122                         <xref linkend="tsvn-dug-settings-main"/> for more information. \r
123                 </para>\r
124         </tip>\r
125   -->\r
126   <!--\r
127         <tip>\r
128                 <title>Ignoring Versioned Items</title>\r
129                 <para>\r
130                         Versioned files and folders can never be ignored - that's a feature\r
131                         of Git. If you versioned a file by mistake, read\r
132                         <xref linkend="tsvn-howto-unversion"/> for instructions on how to\r
133                         <quote>unversion</quote> it.\r
134                 </para>\r
135         </tip>\r
136   -->\r
137         <sect2 id="tsvn-dug-ignore-glob">\r
138                 <title>Pattern Matching in Ignore Lists</title>\r
139                 <indexterm>\r
140                         <primary>globbing</primary>\r
141                 </indexterm>\r
142                 <indexterm>\r
143                         <primary>pattern matching</primary>\r
144                 </indexterm>\r
145                 <para>\r
146                         Git's ignore patterns make use of filename globbing,\r
147                         a technique originally used in Unix to specify files using\r
148                         meta-characters as wildcards. The following characters have\r
149                         special meaning:\r
150                         <variablelist>\r
151                                 <varlistentry>\r
152                                         <term>*</term>\r
153                                         <listitem>\r
154                                                 <para>\r
155                                                         Matches any string of characters, including\r
156                                                         the empty string (no characters).\r
157                                                 </para>\r
158                                         </listitem>\r
159                                 </varlistentry>\r
160                                 <varlistentry>\r
161                                         <term>?</term>\r
162                                         <listitem>\r
163                                                 <para>\r
164                                                         Matches any single character.\r
165                                                 </para>\r
166                                         </listitem>\r
167                                 </varlistentry>\r
168                                 <varlistentry>\r
169                                         <term>[...]</term>\r
170                                         <listitem>\r
171                                                 <para>\r
172                                                         Matches any one of the characters enclosed in the\r
173                                                         square brackets. Within the brackets, a pair of\r
174                                                         characters separated by <quote>-</quote>\r
175                                                         matches any character lexically between the two.\r
176                                                         For example <literal>[AGm-p]</literal> matches\r
177                                                         any one of <literal>A</literal>, <literal>G</literal>,\r
178                                                         <literal>m</literal>, <literal>n</literal>,\r
179                                                         <literal>o</literal> or <literal>p</literal>.\r
180                                                 </para>\r
181                                         </listitem>\r
182                                 </varlistentry>\r
183                         </variablelist>\r
184                 </para>\r
185                 <para>\r
186                         Pattern matching is case sensitive, which can cause problems\r
187                         on Windows. You can force case insensitivity the hard way\r
188                         by pairing characters, eg. to ignore <literal>*.tmp</literal>\r
189                         regardless of case, you could use a pattern like\r
190                         <literal>*.[Tt][Mm][Pp]</literal>.\r
191                 </para>\r
192     <!--\r
193                 <para>\r
194                         If you want an official definition for globbing, you can find\r
195                         it in the IEEE specifications for the shell command language\r
196                         <ulink url="http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13">\r
197                                 <citetitle>Pattern Matching Notation</citetitle>\r
198                         </ulink>.\r
199                 </para>\r
200     \r
201                 <tip>\r
202                         <title>No Paths in Global Ignore List</title>\r
203                         <para>\r
204                                 You should not include path information in your pattern.\r
205                                 The pattern matching is intended to be used against plain\r
206                                 file names and folder names.\r
207                                 If you want to ignore all <literal>CVS</literal> folders,\r
208                                 just add <literal>CVS</literal> to the ignore list. There is\r
209                                 no need to specify <literal>CVS */CVS</literal> as you did in\r
210                                 earlier versions.\r
211                                 If you want to ignore all <literal>tmp</literal> folders\r
212                                 when they exist within a <literal>prog</literal> folder but\r
213                                 not within a <literal>doc</literal> folder you should use the\r
214                                 <literal>svn:ignore</literal> property instead. There is no\r
215                                 reliable way to achieve this using global ignore patterns.\r
216                         </para>\r
217                 </tip>\r
218     -->\r
219         </sect2>\r
220 </sect1>\r