Describe add finished in doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / tgit_dug / dug_add.xml
blob6675fde2e5bce58156c8e49937baf44a76831924
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">\r
3 <sect1 id="tgit-dug-add">\r
4         <title>Adding New Files</title>\r
5         <indexterm>\r
6                 <primary>add</primary>\r
7         </indexterm>\r
8         <indexterm>\r
9                 <primary>version new files</primary>\r
10         </indexterm>\r
11         <?dbhh topicname="HIDD_ADD"?>\r
12         <para>\r
13                 <figure id="tgit-dug-adding-dia-1">\r
14                         <title>Explorer context menu for unversioned files</title>\r
15                         <graphic fileref="../images/ContextMenuFileNoControl.png"/>\r
16                 </figure>\r
17                 If you created new files during\r
18                 your development process then you need to add them\r
19                 to source control too. Select the file(s) and/or NOT empty directory\r
20                 and use\r
21                 <menuchoice>\r
22                         <guimenu>TortoiseGit</guimenu>\r
23                         <guimenuitem>Add</guimenuitem>\r
24                 </menuchoice>.\r
25         </para>\r
26         <para>\r
27                 After you added the files to source control\r
28                 the file appears with a <literal>added</literal> icon overlay which means you\r
29                 first have to commit (and push) your working tree to make those\r
30                 files available to other developers.\r
31                 Just adding a file does <emphasis>not</emphasis> affect any remote\r
32                 repository!\r
33         </para>\r
34         <tip>\r
35                 <title>Many Adds</title>\r
36                 <para>\r
37                         You can also use the Add command on\r
38                         folders. In that case, the add dialog will show you all\r
39                         unversioned files inside that versioned folder.\r
40                         This helps if you have many new files and need to add\r
41                         them all at once.\r
42                 </para>\r
43         </tip>\r
44         <tip>\r
45                 <title>Empty directories</title>\r
46                 <para>\r
47                         Git only tracks content and, thus, cannot version (empty) directories. If you\r
48                         need a directory to be automatically created on checkout, make sure at least one\r
49                         versioned file is in it (e.g. a placeholder file such as <filename>.gitkeep</filename> or <filename>.gitignore</filename>).\r
50                 </para>\r
51         </tip>\r
52         <para>\r
53                 To add files from outside your working tree you can use\r
54                 the drag-and-drop handler:\r
55                 <orderedlist>\r
56                         <listitem>\r
57                                 <para>\r
58                                         select the files you want to add\r
59                                 </para>\r
60                         </listitem>\r
61                         <listitem>\r
62                                 <para>\r
63                                         <action>right-drag</action> them\r
64                                         to the new location inside the working tree\r
65                                 </para>\r
66                         </listitem>\r
67                         <listitem>\r
68                                 <para>\r
69                                         release the right mouse button\r
70                                 </para>\r
71                         </listitem>\r
72                         <listitem>\r
73                                 <para>\r
74                                         select\r
75                                         <menuchoice>\r
76                                                 <guimenu>Context Menu</guimenu>\r
77                                                 <guimenuitem>Git Add copy and add files</guimenuitem>\r
78                                         </menuchoice>.\r
79                                         The files will then be copied to the working tree and\r
80                                         added to version control.\r
81                                 </para>\r
82                         </listitem>\r
83                 </orderedlist>\r
84         </para>\r
85         <para>\r
86                 You can also add files within a working tree simply by (left-)dragging and\r
87                 dropping them onto the commit dialog.\r
88         </para>\r
89         <para>\r
90                 If you add a file by mistake, you can undo the addition\r
91                 before you commit using\r
92                 <menuchoice>\r
93                         <guimenu>TortoiseGit</guimenu>\r
94                         <guimenuitem>Delete (keep local)...</guimenuitem>\r
95                 </menuchoice>\r
96                 or <guimenuitem>Revert</guimenuitem>.\r
97         </para>\r
98         <para>\r
99                 <figure id="tgit-dug-addfinish-1">\r
100                         <title>Add finished</title>\r
101                         <graphic fileref="../images/AddFinish.png"/>\r
102                 </figure>\r
103                 After adding the files, you may commit by clicking the shortcut menu button.\r
104                 Additionally, there are options to mark the newly added files as executable / symlink.\r
105                 Remember to mark executable bit for files such as Unix shell script.\r
106                 This is to facilitate sharing repository with Linux / MacOS environment.\r
107         </para>\r
108         <para>\r
109                 You can find more information at <xref linkend="git-add(1)"/>\r
110         </para>\r
111 </sect1>\r