{"id":1537,"date":"2010-08-31T19:11:59","date_gmt":"2010-08-31T13:41:59","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=1537"},"modified":"2016-12-19T15:04:07","modified_gmt":"2016-12-19T09:34:07","slug":"git-stash-a-very-useful-command","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/git-stash-a-very-useful-command\/","title":{"rendered":"Git Stash : A very useful command"},"content":{"rendered":"<p>We have been using GitHub for version control in one of our projects and I am absolutely loving it! There are quite many advantages over a concurrent version control system like subversion.<\/p>\n<p>One of the commands I found useful was the stash command. It is of use when we are working on a piece of functionality, which is not in a state to be committed, but find that there is a bug\/issue in a previously committed piece of code and want to fix it before proceeding with any further development.<\/p>\n<p>In that case, what we can do is issue the command<\/p>\n<blockquote>\n<pre lang=\"groovy\">git stash save \"work in progress\"<\/pre>\n<\/blockquote>\n<p>Once that is done, it is a save point. Now you can revert the code for that particular branch by using the checkout command.<br \/>\nAfter fixing the issue and committing it (and pushing it) we can get back the copy on which we were working, with the command,<\/p>\n<blockquote>\n<pre lang=\"groovy\">git stash pop<\/pre>\n<\/blockquote>\n<p>A very elegant command in what would&#8217;ve been an otherwise tedious job,<\/p>\n<p>Hope this helps.<\/p>\n<p>Vivek<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have been using GitHub for version control in one of our projects and I am absolutely loving it! There are quite many advantages over a concurrent version control system like subversion. One of the commands I found useful was the stash command. It is of use when we are working on a piece of [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0},"categories":[1],"tags":[375,374,376],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/1537"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=1537"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/1537\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=1537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=1537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=1537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}