<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://kb.owrench.com/index.php?action=history&amp;feed=atom&amp;title=GIT_stash</id>
	<title>GIT stash - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://kb.owrench.com/index.php?action=history&amp;feed=atom&amp;title=GIT_stash"/>
	<link rel="alternate" type="text/html" href="http://kb.owrench.com/index.php?title=GIT_stash&amp;action=history"/>
	<updated>2026-05-04T04:23:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://kb.owrench.com/index.php?title=GIT_stash&amp;diff=137&amp;oldid=prev</id>
		<title>imported&gt;Kishor at 09:53, 9 March 2018</title>
		<link rel="alternate" type="text/html" href="http://kb.owrench.com/index.php?title=GIT_stash&amp;diff=137&amp;oldid=prev"/>
		<updated>2018-03-09T09:53:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
An example of the stashing is shown below. &amp;lt;br&amp;gt;&lt;br /&gt;
** Made a change in a file. &amp;lt;br&amp;gt;&lt;br /&gt;
** git stash save &amp;quot;message about change&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
** git stash list     (lists stashes) &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
stash@{0}: msg1 &amp;lt;br&amp;gt;&lt;br /&gt;
stash@{1}:msg2 &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After stashed, you can now switch branches, work on other things etc. &amp;lt;br&amp;gt;&lt;br /&gt;
When ready, you can take the stash back, by using the below bethods. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(a)  git stash apply stash@{0} &amp;lt;br&amp;gt;      (got the changes back) &amp;lt;br&amp;gt;&lt;br /&gt;
git stash list                           (see the stash is still there, not deleted) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(b) git stash pop &amp;lt;br&amp;gt;&lt;br /&gt;
This takes the stash on top of list and applies it, then delete the stash. &amp;lt;br&amp;gt;&lt;br /&gt;
''Note:'' &amp;lt;br&amp;gt;&lt;br /&gt;
'' Multiple stashes can be added as needed.'' &amp;lt;br&amp;gt;&lt;br /&gt;
'' To simply delete a stash:'' &amp;lt;br&amp;gt;&lt;br /&gt;
git stash drop stash@{0} &amp;lt;br&amp;gt;&lt;br /&gt;
git stash clear &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note: stashes can be carried over to other branches too. &amp;lt;br&amp;gt;&lt;br /&gt;
For this, &amp;lt;br&amp;gt;&lt;br /&gt;
You can do one stash at (say) master branch, and then do a 'git stash pop' at any other branch (say development). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:it-support]]&lt;br /&gt;
[[Category:development]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Kishor</name></author>
		
	</entry>
</feed>