Fixed issue #4148: Dialogs 1 doesn't have documentation for the Default limitation...
[TortoiseGit.git] / doc / source / en / TortoiseGit / tgit_dug / dug_stash.xml
blob6199c9b3562877cc7750f16d2da88452522e6f7f
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">\r
3 <sect1 id="tgit-dug-stash">\r
4         <?dbhh topicname="HIDD_STASH"?>\r
5         <title>Stash Changes</title>\r
6         <indexterm>\r
7                 <primary>stash</primary>\r
8         </indexterm>\r
9         <para>\r
10                 Often, when you’ve been working on part of your project, things are in a messy state and you want to switch branches for a bit to work on something else.\r
11                 The problem is, you don’t want to do a commit of half-done work just so you can get back to this point later. The answer to this issue is the git stash command.\r
12         </para>\r
13         <para>\r
14                 Stashing takes the dirty state of your working directory — that is, your modified tracked files and staged changes — and saves it on a stack of unfinished changes that you can reapply at any time (even on a different branch).\r
15         </para>\r
16         <tip>\r
17                 <para>\r
18                         There is a similar function in TortoiseGit called changelists (<xref linkend="tgit-dug-changelists"/>) which can be used to structure commits.\r
19                 </para>\r
20         </tip>\r
21         <para>\r
22                 When you want to record the current state of the working directory and the index,\r
23                 but want to go back to a clean working directory,\r
24                 <action>right click</action> on a folder to pop up the context menu and then select\r
25                 the command\r
26                 <menuchoice>\r
27                         <guimenu>TortoiseGit</guimenu>\r
28                         <guimenuitem>Stash changes</guimenuitem>\r
29                 </menuchoice>\r
30                 A dialog will pop up where you can optionally enter a message for this state:\r
31                 <figure id="tgit-dug-stash-dia-1">\r
32                         <title>Stash changes dialog</title>\r
33                         <graphic fileref="../images/stash.png"/>\r
34                 </figure>\r
35                 You can also select <guilabel>include untracked</guilabel>, to stash untracked files away, too.\r
36                 To stash all files away, including ignored files in addition to the untracked files, select <guilabel>--all</guilabel>.\r
37         </para>\r
38         <para>\r
39                 When TortoiseGit detects that a stashed changes exist, the context menu will be extended:\r
40                 <figure id="tgit-dug-stash-dia-2">\r
41                         <title>(un)stash options</title>\r
42                         <graphic fileref="../images/ContextMenuStash.png"/>\r
43                 </figure>\r
44                 The stash is implemented as a stack. <guimenuitem>Stash Apply</guimenuitem> will apply the changes of the latest stash\r
45                 to your working tree. <guimenuitem>Stash Pop</guimenuitem> does the same, but will remove the latest stash from the stack\r
46                 after applying it. <guimenuitem>Stash changes</guimenuitem> is still possible and will stash the current changes of the working\r
47                 copy to the top of the stack. <guimenuitem>Stash List</guimenuitem> provides an overview of all the whole stash stack. You\r
48                 can also remove and view the stashed changes there (similarly to the <xref linkend="tgit-dug-showlog"/> and <xref linkend="tgit-dug-reflog"/>).\r
49         </para>\r
50         <important>\r
51                 <title>Conflicts</title>\r
52                 <para>\r
53                         Although major merge work is done by git automatically applying a stash, a conflict may happen during cherry-picking (i.e., a file was modified in your current branch and also in the stash),\r
54                         please see <xref linkend="tgit-dug-conflicts"/> on how to resolve conflicts.\r
55                 </para>\r
56                 <para>\r
57                         Please note, that "REMOTE"/"theirs" in the conflict editor refers to the to be merged stash and "LOCAL"/"mine" to your version in the working tree before you applied the stash.\r
58                 </para>\r
59         </important>\r
60         <para>\r
61                 You can find more information at <gitdoclink cmd="git-stash" section="1"/>.\r
62         </para>\r
63 </sect1>\r