{"id":621,"date":"2013-07-12T14:15:16","date_gmt":"2013-07-12T14:15:16","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=621"},"modified":"2017-08-31T09:50:42","modified_gmt":"2017-08-31T09:50:42","slug":"git-staging-area-aka-index","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=621","title":{"rendered":"Git: Staging Area aka &#8220;index&#8221;"},"content":{"rendered":"<ul>\n<li>Working Tree<\/li>\n<li>Index \/ Stage \/ Staging Area \/ Cache<\/li>\n<li>Repository<\/li>\n<\/ul>\n<p>The Staging Area (also called the &#8220;index&#8221;) is where Git remembers which changes are marked to be committed. If a change is not &#8220;staged&#8221; it will not be committed. A change can be as granular as a single changed line in a file, leading to very precise commits. If, after staging a change, you decide you don&#8217;t want that change to go into the next commit, you can also &#8220;unstage&#8221; it.<\/p>\n<p>Stage file: $ git add <file><br \/>\nUnstage file: $ git reset HEAD <file><\/p>\n<p><a href=\"http:\/\/git-scm.com\/book\/en\/Git-Basics-Undoing-Things\">Git Basics &#8211; Undoing Things<\/a><\/p>\n<p><strong>Removing untracked files from your git working copy<\/strong><br \/>\n$ git clean -f<\/p>\n<p><a href=\"http:\/\/git-scm.com\/docs\/git-clean\">git-clean<\/a><br \/>\n<a href=\"stackoverflow.com\/questions\/61212\/removing-untracked-files-from-your-git-workinag-copy\">Removing untracked files from your git working copy<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Working Tree Index \/ Stage \/ Staging Area \/ Cache Repository The Staging Area (also called the &#8220;index&#8221;) is where Git remembers which changes are marked to be committed. If a change is not &#8220;staged&#8221; it will not be committed. A change can be as granular as a single changed line in a file, leading [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-621","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=621"}],"version-history":[{"count":5,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/621\/revisions"}],"predecessor-version":[{"id":6674,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/621\/revisions\/6674"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}