Update EGit eclipse help from wiki
[egit.git] / org.eclipse.egit.doc / help / EGit / User_Guide / Inspecting-the-state-of-the-Repository.html
blobabb3fe22bf14aaf79539bdc1de1a8d010e083a3c
1 <?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5 <title>EGit User Guide - Inspecting the state of the Repository</title>
6 <link type="text/css" rel="stylesheet" href="../../book.css"/>
7 </head>
8 <body>
9 <table class="navigation" style="width: 100%;" border="0" summary="navigation">
10 <tr>
11 <th style="width: 100%" align="center" colspan="3">Inspecting the state of the Repository</th>
12 </tr>
13 <tr>
14 <td style="width: 20%" align="left">
15 <a href="Working-with-remote-Repositories.html" title="Working with remote Repositories">
16 <img alt="Previous" border="0" src="../../images/prev.gif"/>
17 </a>
18 </td>
19 <td style="width: 60%" align="center"></td>
20 <td style="width: 20%" align="right">
21 <a href="Committing-Changes.html" title="Committing Changes">
22 <img alt="Next" border="0" src="../../images/next.gif"/>
23 </a>
24 </td>
25 </tr>
26 <tr>
27 <td style="width: 20%" align="left" valign="top">Working with remote Repositories</td>
28 <td style="width: 60%" align="center"></td>
29 <td style="width: 20%" align="right" valign="top">Committing Changes</td>
30 </tr>
31 </table><hr/>
32 <h1 id="Inspecting_the_state_of_the_Repository">Inspecting the state of the Repository</h1>
33 <h2 id="Label_Decorations">Label Decorations</h2>
34 <p>Label decorations show Git specific information on resources under Git version control. They appear in all views showing model objects, like Package Explorer, Project Explorer, Navigator, Hierarchy View. </p>
35 <p>The Git label decorations can be switched on globally in the Preference Menu (Window -&gt; Preferences) under General -&gt; Appearance -&gt; Label Decorations. </p>
36 <p>More detailed settings can be done in the Preferences under Team -&gt; Git -&gt; Label Decorations. </p>
37 <p>There are two different types of label decorations: text decorations and icon decorations. </p>
38 <p>
39 <b>Text Decorations</b>
40 <br/> Text decorations appear on the left or right side of the text label. They can be configured on the Preferences dialog under Team -&gt; Git -&gt; Label Decorations on the tab "Text Decorations". For example, the default for a dirty resource is a &gt; on the left side of its name.
41 </p>
42 <p>These are the default settings: </p>
43 <p>
44 <img border="0" src="images/01-TextDecorations.png"/>
45 </p>
46 <p>For files and folders there are the variables "name", "dirty" and "staged". "Dirty" and "staged" are flags; if they are true, the text after the colon is displayed.</p>
47 <p>For projects there are the additional variables "repository" and "branch". The "repository" variable displays the name of the repository.</p>
48 <p>The "branch" variable displays the name of the currently checked out branch. If no branch is checked out, the decoration shows the shortened name of the commit (first seven characters followed by ellipsis). If tags and/or remote branches are pointing to this commit, a "best guess" heuristic is applied to also show this information: tags take precedence over remote branches, if several tags apply, the newest one is displayed; if there are several remote branches or tags have no modification date, then alphabetic sorting is applied and the last one is shown. Example: the checked out commit "e49f576..." refers to tag "v.0.7.1" of&nbsp;repository "egit":
49 <br/>
50 </p>
51 <p>
52 <img border="0" src="images/03-ExampleDecoration.png"/>
53 </p>
54 <p>
55 <b>Icon Decorations</b>
56 <br/> Icon decorations appear on the lower right corner of the icon displayed in front of the label. They can be configured on the Preferences dialog under Team -&gt; Git -&gt; Label Decorations on the tab "Icon Decorations".
57 </p>
58 <p>These are the default decorations: </p>
59 <p>
60 <img border="0" src="images/02-IconDecorations.png"/>
61 </p>
62 <ul>
63 <li>
64 <b>dirty (folder)</b> - At least one file below the folder is dirty; that means that it has changes in the working tree that are neither in the index nor in the repository.
65 </li>
66 <li>
67 <b>tracked</b> - The resource is known to the Git repository and hence under version control.
68 </li>
69 <li>
70 <b>untracked</b> - The resource is not known to the Git repository and will not be version controlled until it is explicitly added.
71 </li>
72 <li>
73 <b>ignored</b> - The resource is ignored by the Git team provider. Here only the preference settings under Team -&gt; Ignored Resources and the "derived" flag are relevant. Settings from .gitignore files are not yet taken into account.
74 </li>
75 <li>
76 <b>dirty</b> - The resource has changes in the working tree that are neither in the index nor in the repository.
77 </li>
78 <li>
79 <b>staged</b> - The resource has changes which have been added to the index. Note that adding changes to the index is currently possible only in the commit dialog via the context menu of a resource.
80 </li>
81 <li>
82 <b>partially-staged</b> - The resource has changes which are added to the index and additional changes in the working tree that neither reached the index nor have been committed to the repository.
83 </li>
84 <li>
85 <b>added</b> - The resource has not yet reached any commit in the repository but has been freshly added to the Git repository in order to be tracked in future.
86 </li>
87 <li>
88 <b>removed</b> - The resource is staged for removal from the Git repository.
89 </li>
90 <li>
91 <b>conflict</b> - A merge conflict exists for the file.
92 </li>
93 <li>
94 <b>assume-valid</b> - The resource has the "assume unchanged" flag. This means that Git stops checking the working tree files for possible modifications, so you need to manually unset the bit to tell Git when you change the working tree file. This setting can be switched on with the menu action Team-&gt;Assume unchanged (or on the command line with git update-index --assume-unchanged). Currently it can only be switched back on the command line with git update-index --no-assume-unchanged.
95 </li>
96 </ul>
97 <h2 id="History_View">History View</h2>
98 <p>The History View displays the the history of the files versioned in a Git repository.
99 Open the History View by selecting "Show In -&gt; History View" from the context menu on any resource under Git version control.</p>
101 <img border="0" src="images/Egit-0.8-history-view.png"/>
102 </p>
103 <p>The top level pane is the commit graph displaying the commit log in reverse chronological order (newest commit on top).</p>
105 <img border="0" src="images/Egit-0.8-history-view-branches.png"/>
106 <br/>
107 </p>
108 <ul>
109 <li>The tips of local branches are shown as green rectangles</li>
110 <li>The tips of remote branches are shown as grey rectangles</li>
111 <li>The local HEAD is shown as a white rectangle</li>
112 </ul>
114 <img border="0" src="images/Egit-0.8-history-view-tag.png"/>
115 <br/>
116 </p>
117 <ul>
118 <li>Tags are shown as yellow rectangles</li>
119 </ul>
120 <p>The lower two panes show the details of the selected commit.
121 In the lower right pane the files affected by the commit are listed.</p>
122 <p>The letter in the first column of this table describes the nature of the change for this file:</p>
123 <dl>
124 <dd>
125 <b>A</b> &nbsp;the file was added by the commit
126 </dd>
127 <dd>
128 <b>M</b> &nbsp;the file was modified by the commit
129 </dd>
130 <dd>
131 <b>D</b> &nbsp;the file was deleted by the commit
132 </dd>
133 </dl>
134 <p>In the lower left pane the commit message and some of its metadata and the git diff for the affected files are listed.</p>
135 <h3 id="History_View_Configuration">History View Configuration</h3>
136 <p>The toggle buttons in the the view toolbar control how the displayed commits are filtered with respect to the context set by the resource selected in e.g. the Navigator or Package Explorer view:</p>
138 <img border="0" src="images/Egit-0.8-history-view-toggle-none.png"/>
140 <br/>If none of the toggle buttons is down the commit log is filtered to show only commits which affected the selected resource.
141 </p>
143 <img border="0" src="images/Egit-0.8-history-view-toggle-folder.png"/>
145 <br/>If the right-most toggle is down the commit log is filtered to show all commits which affected any of the resources in the selected resource's parent folder.
146 </p>
148 <img border="0" src="images/Egit-0.8-history-view-toggle-project.png"/>
150 <br/>If the middle toggle is down the commit log is filtered to show all commits which affected any of the resources in the selected resource's project.
151 </p>
153 <img border="0" src="images/Egit-0.8-history-view-toggle-repository.png"/>
155 <br/>If the left toggle is down the commit log is not filtered and shows all commits reachable from the currently checked out branch.
156 </p>
157 <p>When the toggle button with the magnifying glass is down a search bar is displayed which allows to search for commits in the commit log:
158 <br/>
160 <img border="0" src="images/Egit-0.8-history-view-toggle-magnifier.png"/>
161 </p>
162 <p>Depending on the setting in the drop-down list in the search bar the commit's title, comments, author or committer are searched.
164 <br/> The found search hits are high-lighted in bold and the "next" and "previous" buttons allow to jump to the next or previous commit matching the search criteria.
165 <br/>
167 <img border="0" src="images/Egit-0.8-history-view-search.png"/>
168 </p>
169 <p>The configuration drop-down menu in the view's toolbar allows to change formatting rules for the commit message and controls if the lower two panes of the History View should be displayed:
171 <br/>
173 <img border="0" src="images/Egit-0.8-history-view-configuration.png"/>
174 </p>
175 <h2 id="Commit_Dialog">Commit Dialog</h2>
176 <p>A summary of the status of all modified tracked files is displayed on the commit dialog. By double clicking a file the changes to be committed will be displayed in a compare dialog. As EGit currently always commits the content of the working tree (corresponding to git commit -a on the command line) the compare dialog will compare the working tree with the last commit.</p>
177 <h2 id="Comparing_Content">Comparing Content</h2>
178 <p>In daily work you will often want to see the changes between your last commit, the index, and the current working tree. </p>
180 <img border="0" src="images/03-CompareWith.png"/>
181 </p>
182 <p>Currently a compare dialog can only be opened for a single selected file. </p>
184 <b>Compare working tree with last commit</b>
185 <br/> The difference between a file in the current working directory and in the last commit in the current branch can be viewed from the context menu "Compare With" -&gt; "HEAD revision". This feature is also available in the Commit dialog. Double clicking on an entry in the Commit dialog opens a compare dialog.
186 </p>
188 <b>Compare working tree with index</b>
189 <br/> The difference between a file in the current working directory and in the index can be viewed from the context menu "Compare With" -&gt; "Git Index".
190 </p>
192 <b>Compare working tree with any commit</b>
193 <br/>
194 </p>
195 <ul>
196 <li>Select a file in the package explorer </li>
197 <li>from the context menu select "Show in" &gt; "History" or "Compare With" -&gt; "History..."</li>
198 <li>in the commit graph select a commit </li>
199 <li>from the context menu select "Compare with working tree" </li>
200 <li>this will open a compare dialog showing the changes between the selected commit and the current working tree</li>
201 </ul>
203 <b>Compare two commits with each other</b>
204 <br/>
205 </p>
206 <ul>
207 <li>Select a file in the package explorer </li>
208 <li>from the context menu select "Show in" &gt; "History" or "Compare With" -&gt; "History..."</li>
209 <li>in the commit graph select two commits </li>
210 <li>from the context menu select "Compare with each other" </li>
211 <li>this will open a compare dialog showing the changes between the two selected commits</li>
212 </ul>
214 <b>Compare index with HEAD or any other commit</b>
215 <br/> This feature is not implemented yet.
216 </p>
217 <h2 id="Quickdiff">Quickdiff</h2>
218 <p>Instead of using a compare editor you can enable quick diff support and see the changes within the text editor.
220 <br/>This feature can be enabled via the General &gt; Editors &gt; Text Editors &gt; Quick Diff preference page:
221 </p>
223 <img border="0" src="images/04-QuickDiffPreferences.png"/>
224 </p>
225 <p>The difference annotation will then be displayed on the left hand side of the editor: </p>
227 <img border="0" src="images/05-QuickDiffInEditor.png"/>
228 </p>
229 <p>If you move your mouse over the annotation you see the content of the version you are comparing to: </p>
231 <img border="0" src="images/06-QuickDiffInEditorPopup.png"/>
232 </p>
233 <p>Per default, the comparison is against the HEAD. You can determine the version you are comparing to, the so-called quickdiff baseline, from the context menu of a commit in the history view (Show in -&gt; History). There are three menu entries: </p>
234 <ul>
235 <li>
236 <b>Quick Diff -&gt; Reset baseline to first parent of HEAD</b> - Compare against the first commit before HEAD.
237 </li>
238 <li>
239 <b>Quick Diff -&gt; Reset baseline to HEAD</b> - Compare against HEAD.
240 </li>
241 <li>
242 <b>Quick Diff -&gt; Set as baseline</b> - Compare against the selected commit
243 </li>
244 </ul>
245 <h2 id="View_Diff_for_a_Commit">View Diff for a Commit</h2>
246 <p>To display the diff for a given commit </p>
247 <ul>
248 <li>from context menu in package explorer select "Team" &gt; "Show in Resource History" </li>
249 <li>select the commit you want to inspect </li>
250 <li>the history view will display the diff in the lower left pane</li>
251 <li>selecting a file in the lower right pane will scroll to the corresponding file section of the diff</li>
252 </ul>
254 <img border="0" src="images/EGit-0.7-ViewDiffInResourceHistory.png"/>
255 </p><hr/>
256 <table class="navigation" style="width: 100%;" border="0" summary="navigation">
257 <tr>
258 <td style="width: 20%" align="left">
259 <a href="Working-with-remote-Repositories.html" title="Working with remote Repositories">
260 <img alt="Previous" border="0" src="../../images/prev.gif"/>
261 </a>
262 </td>
263 <td style="width: 60%" align="center">
264 <a href="User-Guide.html" title="EGit User Guide">
265 <img alt="EGit User Guide" border="0" src="../../images/home.gif"/>
266 </a>
267 </td>
268 <td style="width: 20%" align="right">
269 <a href="Committing-Changes.html" title="Committing Changes">
270 <img alt="Next" border="0" src="../../images/next.gif"/>
271 </a>
272 </td>
273 </tr>
274 <tr>
275 <td style="width: 20%" align="left" valign="top">Working with remote Repositories</td>
276 <td style="width: 60%" align="center"></td>
277 <td style="width: 20%" align="right" valign="top">Committing Changes</td>
278 </tr>
279 </table>
280 </body>
281 </html>