Update doc for "Changing case in a filename"
[TortoiseGit.git] / doc / source / en / TortoiseGit / tgit_dug / dug_rename.xml
blobe8790dea9b9aeef77b27a45ddd1de519a1690ea0
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">\r
3 <sect1 id="tgit-dug-rename">\r
4         <title>Deleting, Moving and Renaming</title>\r
5         <para>\r
6                 Unlike CVS, Git allows renaming and moving of files and\r
7                 folders. So there are menu entries for delete and rename\r
8                 in the TortoiseGit submenu.\r
9                 <figure id="tgit-dug-renaming-dia-1">\r
10                         <title>Explorer context menu for versioned files</title>\r
11                         <graphic fileref="../images/ContextMenuFileControl.png"/>\r
12                 </figure>\r
13         </para>\r
14         <sect2 id="tgit-dug-rename-delete">\r
15                 <title>Deleting files and folders</title>\r
16                 <indexterm>\r
17                         <primary>delete</primary>\r
18                 </indexterm>\r
19                 <indexterm>\r
20                         <primary>remove</primary>\r
21                 </indexterm>\r
22                 <para>\r
23                         Use\r
24                         <menuchoice>\r
25                                 <guimenu>TortoiseGit</guimenu>\r
26                                 <guimenuitem>Delete</guimenuitem>\r
27                         </menuchoice>\r
28                         to remove files or folders from Git.\r
29                 </para>\r
30                 <para>\r
31                         When you \r
32                         <menuchoice>\r
33                                 <guimenu>TortoiseGit</guimenu>\r
34                                 <guimenuitem>Delete</guimenuitem>\r
35                         </menuchoice>\r
36                         a file, it is removed from your working tree immediately as well\r
37                         as being marked for deletion in the repository on next commit.\r
38 <!--\r
39                         The file's parent folder shows a <quote>deleted</quote> icon overlay.\r
40 -->\r
41                         Up until you commit the change, you can get the file back using\r
42                         <menuchoice>\r
43                                 <guimenu>TortoiseGit</guimenu>\r
44                                 <guimenuitem>Revert</guimenuitem>\r
45                         </menuchoice>\r
46                         on the parent folder.\r
47                 </para>\r
48                 <para>\r
49                         If you want to delete an item from the repository, but keep it\r
50                         locally as an unversioned file/folder, use\r
51                         <menuchoice>\r
52                                 <guimenu>Extended Context Menu</guimenu>\r
53                                 <guimenuitem>Delete (keep local)</guimenuitem>\r
54                         </menuchoice>.\r
55                         You might have to hold the <keycap>Shift</keycap> key while right clicking on\r
56                         the item in the explorer list pane (right pane) in order to see this\r
57                         in the extended context menu.\r
58                 </para>\r
59 <!--\r
60                 <para>\r
61                         If a <emphasis>file</emphasis> is deleted via the explorer\r
62                         instead of using the TortoiseGit context menu, the commit\r
63                         dialog shows those files and lets you remove them from\r
64                         version control too before the commit.\r
65                         If you need to delete a version-controlled file, always use\r
66                         <menuchoice>\r
67                                 <guimenu>TortoiseGit</guimenu>\r
68                                 <guimenuitem>Delete</guimenuitem>\r
69                         </menuchoice> so that Git doesn't have to guess what\r
70                         you really want to do.\r
71                 </para>\r
72 -->\r
73     \r
74                 <tip>\r
75                         <title>Getting a deleted file or folder back</title>\r
76                         <para>\r
77                                 If you have deleted a file or a folder and already committed\r
78                                 that delete operation to the repository, then a normal \r
79                                 <menuchoice>\r
80                                         <guimenu>TortoiseGit</guimenu>\r
81                                         <guimenuitem>Revert</guimenuitem>\r
82                                 </menuchoice>\r
83                                 can't bring it back anymore. But the file or folder is not\r
84                                 lost at all. If you know the revision the file or folder got\r
85                                 deleted (if you don't, use the log dialog to find out) open\r
86                                 the repository browser and switch to that revision. Then select\r
87                                 the file or folder you deleted, right-click and select\r
88                                 <menuchoice>\r
89                                         <guimenu>Context Menu</guimenu>\r
90                                         <guimenuitem>Revert to this revision</guimenuitem>\r
91                                 </menuchoice>\r
92                         </para>\r
93                 </tip>\r
94         </sect2>\r
95         <sect2 id="tgit-dug-rename-move">\r
96                 <title>Moving files and folders</title>\r
97                 <indexterm>\r
98                         <primary>rename</primary>\r
99                 </indexterm>\r
100                 <indexterm>\r
101                         <primary>move</primary>\r
102                 </indexterm>\r
103                 <?dbhh topicname="HIDD_RENAME"?>\r
104                 <para>\r
105                         If you want to do a simple in-place rename of a file or\r
106                         folder, use\r
107                         <menuchoice>\r
108                                 <guimenu>Context Menu</guimenu>\r
109                                 <guimenuitem>Rename...</guimenuitem>\r
110                         </menuchoice>\r
111                         Enter the new name for the item and you're done.\r
112                 </para>\r
113                 <para>\r
114                         If you want to move files around inside your working tree,\r
115                         perhaps to a different sub-folder, you can\r
116                         use the right-mouse drag-and-drop handler:\r
117                         <orderedlist>\r
118                                 <listitem>\r
119                                         <para>\r
120                                                 select the files or directories you want to move\r
121                                         </para>\r
122                                 </listitem>\r
123                                 <listitem>\r
124                                         <para>\r
125                                                 <action>right-drag</action> them to the\r
126                                                 new location inside the working tree\r
127                                         </para>\r
128                                 </listitem>\r
129                                 <listitem>\r
130                                         <para>\r
131                                                 release the right mouse button\r
132                                         </para>\r
133                                 </listitem>\r
134                                 <listitem>\r
135                                         <para>\r
136                                                 in the popup menu select\r
137                                                 <menuchoice>\r
138                                                         <guimenu>Context Menu</guimenu>\r
139                                                         <guimenuitem>Git Move versioned files here</guimenuitem>\r
140                                                 </menuchoice>\r
141                                         </para>\r
142                                 </listitem>\r
143                         </orderedlist>\r
144                 </para>\r
145                 <caution>\r
146                         <title>Do Not Git Move Submodule</title>\r
147                         <para>\r
148                                 You should <emphasis>not</emphasis> use the TortoiseGit\r
149                                 <guilabel>Move</guilabel> or <guilabel>Rename</guilabel>\r
150                                 commands on a folder which has been created using\r
151                                 <literal>git submodule</literal>.\r
152                         </para>\r
153                 </caution>\r
154         </sect2>\r
155         <sect2 id="tgit-dug-renameincase">\r
156                 <title>Changing case in a filename</title>\r
157                 <indexterm>\r
158                         <primary>case change</primary>\r
159                 </indexterm>\r
160                 <?dbhh topicname="HIDD_RENAMEINCASE"?>\r
161                 <para>\r
162                         Making case-only changes to a filename needs special attention,\r
163                         because Windows has a case-insensitive file system.\r
164                         Therefore just renaming a file using the rename command of the Explorer is likely not to work.\r
165                         It is important to rename it using Git in order to update the index to make it use the new filename.\r
166                         Use the <guimenuitem>Rename...</guimenuitem> command in the TortoiseGit submenu.\r
167                 </para>\r
168         </sect2>\r
169         <!--\r
170         <sect2 id="tgit-dug-rename-case-conflict">\r
171                 <title>Dealing with filename case conflicts</title>\r
172                 <para>\r
173                         If the repository already contains two files with the same name\r
174                         but differing only in case (e.g. <filename>TEST.TXT</filename>\r
175                         and <filename>test.txt</filename>), you\r
176                         will not be able to commit or checkout the parent directory\r
177                         on a Windows client. Whilst Git supports case-sensitive\r
178                         filenames, Windows does not.\r
179                 </para>\r
180                 <para>\r
181                         This sometimes happens when two people commit, from separate\r
182                         working trees, files which happen to have\r
183                         the same name, but with a case difference. It can also happen\r
184                         when files are committed from a system with a case-sensitive\r
185                         file system, like Linux.\r
186                 </para>\r
187                 <para>\r
188                         In that case, you have to decide which one of them you want to \r
189                         keep and delete (or rename) the other one from the repository.\r
190                 </para>\r
191         </sect2>\r
192         -->\r
193         <sect2 id="tgit-dug-rename-del-unversioned">\r
194                 <title>Deleting Unversioned Files</title>\r
195                 <para>\r
196                         Usually you set your ignore list such that all generated files are ignored\r
197                         in Git. But what if you want to clear all those ignored items to produce\r
198                         a clean build? Usually you would set that in your makefile, but if you are\r
199                         debugging the makefile, or changing the build system it is useful to have a way\r
200                         of clearing the decks.\r
201                 </para>\r
202                 <para>\r
203                         TortoiseGit provides just such an option using\r
204                         <menuchoice>\r
205                                 <guimenu>Extended Context Menu</guimenu>\r
206                                 <guimenuitem>Clean up...</guimenuitem>\r
207                         </menuchoice>.\r
208                         You may have to hold the <keycap>Shift</keycap> while right clicking on a folder\r
209                         in the explorer list pane (right pane) in order to see this in the\r
210                         context menu.\r
211                         This will produce a dialog which lists all possible clean up options: <xref linkend="tgit-dug-cleanup"/>\r
212                 </para>\r
213         </sect2>\r
214 </sect1>\r