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
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
14 <sect2 id="tgit-dug-rename-delete">
\r
15 <title>Deleting files and folders</title>
\r
17 <primary>delete</primary>
\r
20 <primary>remove</primary>
\r
25 <guimenu>TortoiseGit</guimenu>
\r
26 <guimenuitem>Delete</guimenuitem>
\r
28 to remove files or folders from Git.
\r
33 <guimenu>TortoiseGit</guimenu>
\r
34 <guimenuitem>Delete</guimenuitem>
\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
39 The file's parent folder shows a <quote>deleted</quote> icon overlay.
\r
41 Up until you commit the change, you can get the file back using
\r
43 <guimenu>TortoiseGit</guimenu>
\r
44 <guimenuitem>Revert</guimenuitem>
\r
46 on the parent folder.
\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
52 <guimenu>Extended Context Menu</guimenu>
\r
53 <guimenuitem>Delete (keep local)</guimenuitem>
\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
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
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
75 <title>Getting a deleted file or folder back</title>
\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
80 <guimenu>TortoiseGit</guimenu>
\r
81 <guimenuitem>Revert</guimenuitem>
\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
89 <guimenu>Context Menu</guimenu>
\r
90 <guimenuitem>Revert to this revision</guimenuitem>
\r
95 <sect2 id="tgit-dug-rename-move">
\r
96 <title>Moving files and folders</title>
\r
98 <primary>rename</primary>
\r
101 <primary>move</primary>
\r
103 <?dbhh topicname="HIDD_RENAME"?>
\r
105 If you want to do a simple in-place rename of a file or
\r
108 <guimenu>Context Menu</guimenu>
\r
109 <guimenuitem>Rename...</guimenuitem>
\r
111 Enter the new name for the item and you're done.
\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
120 select the files or directories you want to move
\r
125 <action>right-drag</action> them to the
\r
126 new location inside the working tree
\r
131 release the right mouse button
\r
136 in the popup menu select
\r
138 <guimenu>Context Menu</guimenu>
\r
139 <guimenuitem>Git Move versioned files here</guimenuitem>
\r
146 <title>Do Not Git Move Submodule</title>
\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
155 <sect2 id="tgit-dug-renameincase">
\r
156 <title>Changing case in a filename</title>
\r
158 <primary>case change</primary>
\r
160 <?dbhh topicname="HIDD_RENAMEINCASE"?>
\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
170 <sect2 id="tgit-dug-rename-case-conflict">
\r
171 <title>Dealing with filename case conflicts</title>
\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
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
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
193 <sect2 id="tgit-dug-rename-del-unversioned">
\r
194 <title>Deleting Unversioned Files</title>
\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
203 TortoiseGit provides just such an option using
\r
205 <guimenu>Extended Context Menu</guimenu>
\r
206 <guimenuitem>Clean up...</guimenuitem>
\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
211 This will produce a dialog which lists all possible clean up options: <xref linkend="tgit-dug-cleanup"/>
\r