1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">
\r
3 <sect1 id="tsvn-dug-commit">
\r
4 <title>Committing Your Changes To The Repository</title>
\r
6 <primary>commit</primary>
\r
9 <primary>send changes</primary>
\r
12 <primary>check in</primary>
\r
14 <?dbhh topicname="HIDD_COMMITDLG"?>
\r
16 Sending the changes you made to your working tree is known as
\r
17 <firstterm>committing</firstterm> the changes. you can use
\r
19 <guimenu>TortoiseGit</guimenu>
\r
20 <guimenuitem>Check for Modifications</guimenuitem>
\r
22 first, to see which files have changed locally.
\r
24 <sect2 id="tsvn-dug-commit-basics">
\r
25 <title>The Commit Dialog</title>
\r
27 If there are no conflicts,
\r
28 you are ready to commit your changes. Select any file
\r
29 and/or folders you want to commit, then
\r
31 <guimenu>TortoiseGit</guimenu>
\r
32 <guimenuitem>Commit...</guimenuitem>
\r
34 <figure id="tsvn-dug-commit-dia-1">
\r
35 <title>The Commit dialog</title>
\r
36 <graphic fileref="../images/Commit.png"/>
\r
40 The commit dialog will show you every changed file,
\r
41 including added, deleted and unversioned files. If you don't
\r
42 want a changed file to be committed, just uncheck that
\r
43 file. If you want to include an unversioned file,
\r
44 just check that file to add it to the commit.
\r
47 Default commit dialog just list select paths and their child directory files.
\r
48 If you want to list all files of project, you can just click <guilabel>
\r
49 Whole Project</guilabel>
\r
53 Items which have been switched to a different repository path are
\r
54 also indicated using an <literal>(s)</literal> marker. You may have
\r
55 switched something while working on a branch and forgotten to switch
\r
56 back to trunk. This is your warning sign!
\r
61 <title>Commit files or folders?</title>
\r
63 When you commit files, the commit dialog shows only
\r
64 the files you have selected. When you commit a folder
\r
65 the commit dialog will select the changed files automatically.
\r
66 If you forget about a new file you created, committing the
\r
67 folder will find it anyway. Committing a folder does <emphasis>not</emphasis>
\r
68 mean that every file gets marked as changed; It just makes
\r
69 your life easier by doing more work for you.
\r
75 If you have modified files which have been included from a different
\r
76 repository using <literal>svn:externals</literal>, those changes cannot
\r
77 be included in the same atomic commit. A warning symbol below the file
\r
78 list tells you if this has happened, and the tooltip explains that
\r
79 those external files have to be committed separately.
\r
83 <title>Many unversioned files in the commit dialog</title>
\r
85 If you think that the commit dialog shows you too
\r
86 many unversioned (e.g. compiler generated or editor backup)
\r
87 files, there are several ways to handle this. You can:
\r
92 add the file (or a wildcard extension)
\r
93 to the list of files to exclude on the settings page.
\r
94 This will affect every working tree you have.
\r
100 add the file to the <literal>.gitignore</literal> list
\r
103 <guimenu>TortoiseGit</guimenu>
\r
104 <guimenuitem>Add to ignore list</guimenuitem>
\r
107 This will only affect the directory on
\r
108 which you set the <literal>svn:ignore</literal> property.
\r
109 Using the SVN Property Dialog, you can alter the
\r
110 <literal>svn:ignore</literal> property for a directory.
\r
115 Read <xref linkend="tsvn-dug-ignore"/> for more information.
\r
119 <action>Double clicking</action> on any modified file in the commit
\r
120 dialog will launch the external diff tool to show your changes.
\r
121 The context menu will give you more options, as shown in the screenshot.
\r
122 You can also drag files from here into another application such as a
\r
123 text editor or an IDE.
\r
126 You can select or deselect items by clicking on the checkbox to the
\r
127 left of the item. For directories you can use <keycap>Shift</keycap>-<action>select</action>
\r
128 to make the action recursive.
\r
131 The columns displayed in the bottom pane are customizable. If you
\r
132 <action>right click</action> on any column header you will see a
\r
133 context menu allowing you to select which columns are displayed.
\r
134 You can also change column width by using the drag handle which
\r
135 appears when you move the mouse over a column boundary. These
\r
136 customizations are preserved, so you will see the same headings
\r
141 By default when you commit changes, any locks that you hold on files
\r
142 are released automatically after the commit succeeds. If you want
\r
143 to keep those locks, make sure the <guilabel>Keep locks</guilabel>
\r
144 checkbox is checked. The default state of this checkbox is taken
\r
145 from the <literal>no_unlock</literal> option in the Git
\r
146 configuration file. Read <xref linkend="tsvn-dug-settings-main"/>
\r
147 for information on how to edit the Git configuration file.
\r
151 <title>Drag and Drop</title>
\r
154 You can drag files into the commit dialog from elsewhere, so
\r
155 long as the working trees are checked out from the same repository.
\r
156 For example, you may have a huge working tree with several
\r
157 explorer windows open to look at distant folders of the
\r
158 hierarchy. If you want to avoid committing from the top
\r
159 level folder (with a lengthy folder crawl to check for changes)
\r
160 you can open the commit dialog for one folder and drag in items
\r
161 from the other windows to include within the same atomic commit.
\r
164 You can drag unversioned files which reside within a working tree
\r
165 into the commit dialog, and they will be Git added automatically.
\r
171 <title>Repairing External Renames</title>
\r
173 Sometimes files get renamed outside of Git, and they show up
\r
174 in the file list as a missing file and an unversioned file. To avoid
\r
175 losing the history you need to notify Git about the connection.
\r
176 Simply select both the old name (missing) and the new name (unversioned)
\r
179 <guimenu>Context Menu</guimenu>
\r
180 <guimenuitem>Repair Move</guimenuitem>
\r
182 to pair the two files as a rename.
\r
188 <sect2 id="tsvn-dug-commit-changelists">
\r
189 <title>Change Lists</title>
\r
191 The commit dialog supports Git's changelist feature to help
\r
192 with grouping related files together. Find out about this feature
\r
193 in <xref linkend="tsvn-dug-changelists"/>.
\r
198 <sect2 id="tsvn-dug-commit-ignore">
\r
199 <title>Excluding Items from the Commit List</title>
\r
201 Sometimes you have versioned files that change frequently but that you
\r
202 really don't want to commit. Sometimes this indicates a flaw in your
\r
203 build process - why are those files versioned? should you be using
\r
204 template files? But occasionally it is inevitable. A classic reason
\r
205 is that your IDE changes a timestamp in the project file every time
\r
206 you build. The project file has to be versioned as it includes all the
\r
207 build settings, but it doesn't need to be committed just because the
\r
211 To help out in awkward cases like this, we have reserved a changelist
\r
212 called <literal>ignore-on-commit</literal>. Any file added to this
\r
213 changelist will automatically be unchecked in the commit dialog.
\r
214 You can still commit changes, but you have to select it manually
\r
215 in the commit dialog.
\r
219 <sect2 id="tsvn-dug-commit-restore">
\r
220 <title>Commit only parts of files</title>
\r
222 Sometimes you want to only commit parts of the changes
\r
223 you made to a file. Such a situation usually happens when
\r
224 you're working on something but then an urgent fix needs
\r
225 to be committed, and that fix happens to be in the same file
\r
229 <action>right click</action> on the file and use
\r
231 <guimenu>Context Menu</guimenu>
\r
232 <guimenuitem>Restore after commit</guimenuitem>
\r
234 This will create a copy of the file as it is. Then you
\r
235 can edit the file, e.g. in TortoiseMerge and undo all
\r
236 the changes you don't want to commit. After saving those
\r
237 changes you can commit the file.
\r
240 After the commit is done, the copy of the file is restored
\r
241 automatically, and you have the file with all your modifications
\r
242 that were not committed back.
\r
245 <sect2 id="tsvn-dug-commit-log">
\r
246 <title>Commit Log Messages</title>
\r
248 Be sure to enter a log message which describes the changes you are
\r
249 committing. This will help you to see what happened and when, as you
\r
250 browse through the project log messages at a later date. The message
\r
251 can be as long or as brief as you like; many projects have guidelines
\r
252 for what should be included, the language to use, and sometimes even
\r
256 You can apply simple formatting to your log messages using a convention
\r
257 similar to that used within emails.
\r
258 To apply styling to <literal>text</literal>, use
\r
259 <literal>*text*</literal> for bold,
\r
260 <literal>_text_</literal> for underlining, and
\r
261 <literal>^text^</literal> for italics.
\r
264 <figure id="tsvn-dug-commit-dia-2">
\r
265 <title>The Commit Dialog Spellchecker</title>
\r
266 <graphic fileref="../images/CommitSpellcheck.png"/>
\r
268 TortoiseGit includes a spellchecker to help you get your log messages
\r
269 right. This will highlight any mis-spelled words. Use the context menu
\r
270 to access the suggested corrections. Of course, it doesn't know
\r
271 <emphasis>every</emphasis> technical term that you do, so correctly
\r
272 spelt words will sometimes show up as errors. But don't worry. You can
\r
273 just add them to your personal dictionary using the context menu.
\r
276 The log message window also includes a filename and function auto-completion
\r
277 facility. This uses regular expressions to extract class and function names
\r
278 from the (text) files you are committing, as well as the filenames themselves.
\r
279 If a word you are typing matches anything in the list (after you have typed at
\r
280 least 3 characters, or pressed <keycap>Ctrl+Space</keycap>),
\r
281 a drop-down appears allowing you to select the full name.
\r
282 The regular expressions supplied with TortoiseGit are held in the TortoiseGit
\r
283 installation <filename>bin</filename> folder. You can also define your own
\r
284 regexes and store them in <filename>%APPDATA%\TortoiseGit\autolist.txt</filename>.
\r
285 Of course your private autolist will not be overwritten when you update your
\r
286 installation of TortoiseGit. If you are unfamiliar with regular expressions,
\r
287 take a look at the introduction at
\r
288 <ulink url="http://en.wikipedia.org/wiki/Regular_expression">
\r
289 <citetitle>http://en.wikipedia.org/wiki/Regular_expression</citetitle>
\r
291 and the online documentation and tutorial at
\r
292 <ulink url="http://www.regular-expressions.info/">
\r
293 <citetitle>http://www.regular-expressions.info/</citetitle>
\r
298 You can re-use previously entered log messages. Just click on
\r
299 <guibutton>Recent messages</guibutton> to view a list of the last few
\r
300 messages you entered for this working tree. The number of stored messages
\r
301 can be customized in the TortoiseGit settings dialog.
\r
305 You can add your name and email address to end of log message by click
\r
306 <guibutton>Sign</guibutton>
\r
310 You can clear all stored commit messages from the <guilabel>Saved data</guilabel>
\r
311 page of TortoiseGit's settings, or you can clear individual messages from
\r
312 within the <guilabel>Recent messages</guilabel> dialog using the
\r
313 <keycap>Delete</keycap> key.
\r
317 If you want to include the checked paths in your log message, you can use
\r
320 <guimenu>Context Menu</guimenu>
\r
321 <guimenuitem>Paste filename list</guimenuitem>
\r
323 in the edit control.
\r
326 Another way to insert the paths into the log message is to simply
\r
327 drag the files from the file list onto the edit control.
\r
331 <title>Special Folder Properties</title>
\r
333 There are several special folder properties which can be used to
\r
334 help give more control over the formatting of commit log messages and
\r
335 the language used by the spellchecker module.
\r
336 Read <xref linkend="tsvn-dug-propertypage"/> for further information.
\r
341 <title>Integration with Bug Tracking Tools</title>
\r
343 If you have activated the bug tracking system, you can set one or more
\r
344 Issues in the <guilabel>Bug-ID / Issue-Nr:</guilabel> text box. Multiple
\r
345 issues should be comma separated. Alternatively, if you are using
\r
346 regex-based bug tracking support, just add your issue references
\r
347 as part of the log message.
\r
348 Learn more in <xref linkend="tsvn-dug-bugtracker"/>.
\r
353 <sect2 id="tsvn-dug-commit-progress">
\r
354 <title>Commit Progress</title>
\r
356 After pressing <guibutton>OK</guibutton>, a dialog appears displaying
\r
357 the progress of the commit.
\r
358 <figure id="tsvn-dug-commit-dia-3">
\r
359 <title>The Progress dialog showing a commit in progress</title>
\r
360 <graphic fileref="../images/CommitProgress.png"/>
\r
364 The progress dialog uses colour coding to highlight different
\r
371 Committing a modification.
\r
376 <term>Purple</term>
\r
379 Committing a new addition.
\r
384 <term>Dark red</term>
\r
387 Committing a deletion or a replacement.
\r
402 This is the default colour scheme, but you can customise those colours
\r
403 using the settings dialog.
\r
404 Read <xref linkend="tsvn-dug-settings-colours"/> for more information.
\r