{"id":677,"date":"2013-03-05T17:52:52","date_gmt":"2013-03-05T23:52:52","guid":{"rendered":"http:\/\/trillworks.com\/nick\/?p=677"},"modified":"2013-07-29T22:20:11","modified_gmt":"2013-07-30T03:20:11","slug":"exclude-a-file-from-a-git-commit","status":"publish","type":"post","link":"https:\/\/trillworks.com\/nick\/2013\/03\/05\/exclude-a-file-from-a-git-commit\/","title":{"rendered":"Exclude a file from a git commit"},"content":{"rendered":"<p>I need to do this about once a week.<\/p>\n<pre class=\"brush:shell\">git update-index --assume-unchanged path\/to\/file.txt\r\n\r\ngit commit -a -m \"MOBILE-1234: changed a bunch of files but excluded that one I'm saving for later.\"\r\n\r\ngit update-index --no-assume-unchanged path\/to\/file.txt<\/pre>\n<p>If you change 10 files but you only want to commit 9 this will do the trick.<\/p>\n<p>TODO: Complete this git tutorial that blew up on HN a while back.\u00a0<a href=\"http:\/\/pcottle.github.com\/learnGitBranching\/\">http:\/\/pcottle.github.com\/learnGitBranching\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I need to do this about once a week. git update-index &#8211;assume-unchanged path\/to\/file.txt git commit -a -m &#8220;MOBILE-1234: changed a bunch of files but excluded that one I&#8217;m saving for later.&#8221; git update-index &#8211;no-assume-unchanged path\/to\/file.txt If you change 10 files but you only want to commit 9 this will do the trick. TODO: Complete this &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/trillworks.com\/nick\/2013\/03\/05\/exclude-a-file-from-a-git-commit\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Exclude a file from a git commit&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[],"class_list":["post-677","post","type-post","status-publish","format-standard","hentry","category-technical"],"_links":{"self":[{"href":"https:\/\/trillworks.com\/nick\/wp-json\/wp\/v2\/posts\/677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trillworks.com\/nick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trillworks.com\/nick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trillworks.com\/nick\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trillworks.com\/nick\/wp-json\/wp\/v2\/comments?post=677"}],"version-history":[{"count":7,"href":"https:\/\/trillworks.com\/nick\/wp-json\/wp\/v2\/posts\/677\/revisions"}],"predecessor-version":[{"id":942,"href":"https:\/\/trillworks.com\/nick\/wp-json\/wp\/v2\/posts\/677\/revisions\/942"}],"wp:attachment":[{"href":"https:\/\/trillworks.com\/nick\/wp-json\/wp\/v2\/media?parent=677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trillworks.com\/nick\/wp-json\/wp\/v2\/categories?post=677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trillworks.com\/nick\/wp-json\/wp\/v2\/tags?post=677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}