{"id":242,"date":"2018-04-06T13:18:28","date_gmt":"2018-04-06T01:18:28","guid":{"rendered":"https:\/\/content.ronella.xyz\/apps\/wordpress\/?p=242"},"modified":"2018-04-06T13:20:22","modified_gmt":"2018-04-06T01:20:22","slug":"local-working-directory-ignore-in-git","status":"publish","type":"post","link":"https:\/\/www.ronella.xyz\/?p=242","title":{"rendered":"Local Working Directory Ignore in Git"},"content":{"rendered":"<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\">Ignoring files in git can be in the well known <span style=\"font-weight: bold;\">.gitignore file<\/span>\u00a0or in the\u00a0<span style=\"font-weight: bold;\">.git\/info\/exclude file<\/span>.<\/p>\n<p style=\"margin: 0in; margin-top: .25in; font-family: Calibri; font-size: 11.0pt;\"><span style=\"font-weight: bold;\">What's the difference between the two files? <\/span><\/p>\n<div style=\"direction: ltr;\">\n<table style=\"direction: ltr; border-collapse: collapse; border: 1pt solid #A3A3A3;\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"vertical-align: top; width: 1.2479in; padding: 4pt 4pt 4pt 4pt; border: 1pt solid #A3A3A3;\">\n<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\"><span style=\"font-weight: bold;\">File<\/span><\/p>\n<\/td>\n<td style=\"vertical-align: top; width: 5.9791in; padding: 4pt 4pt 4pt 4pt; border: 1pt solid #A3A3A3;\">\n<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\"><span style=\"font-weight: bold;\">Description<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top; width: 1.2479in; padding: 4pt 4pt 4pt 4pt; border: 1pt solid #A3A3A3;\">\n<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\">.gitignore<\/p>\n<\/td>\n<td style=\"vertical-align: top; width: 5.9791in; padding: 4pt 4pt 4pt 4pt; border: 1pt solid #A3A3A3;\">\n<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\">Operates at the repository level and everyone is sharing this file.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top; width: 1.2479in; padding: 4pt 4pt 4pt 4pt; border: 1pt solid #A3A3A3;\">\n<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\">.git\/info\/exclude<\/p>\n<\/td>\n<td style=\"vertical-align: top; width: 5.9791in; padding: 4pt 4pt 4pt 4pt; border: 1pt solid #A3A3A3;\">\n<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\">Operates at the local working directory <span style=\"font-style: italic;\">(i.e. normally the root of the cloned repository)<\/span> level and only you has this file.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p style=\"margin: 0in; margin-top: .25in; font-family: Calibri; font-size: 11.0pt;\"><span style=\"font-weight: bold;\">Exclude File<\/span><\/p>\n<p style=\"margin: 0in; margin-top: .25in; font-family: Calibri; font-size: 11.0pt;\">If .git\/info\/exclude file is present it must have the same formatting rule as the .gitignore file.<\/p>\n<p style=\"margin: 0in; margin-top: .25in; font-family: Calibri; font-size: 11.0pt;\">If the file to be ignored was already in the repository and you can still see it as modified. You can execute the following command:<\/p>\n<pre style=\"margin: 0in; margin-top: .25in; font-family: Calibri; font-size: 11.0pt;\">git update-index --assume-unchanged &lt;FILENAME&gt;<\/pre>\n<p style=\"margin: 0in; margin-top: 0.25in; font-family: Calibri; font-size: 11.0pt;\">Example:<\/p>\n<pre style=\"margin: 0in; margin-top: .25in; font-family: Calibri; font-size: 11.0pt;\">git update-index --assume-unchanged config\/database-config.xml<\/pre>\n<p style=\"margin: 0in; margin-top: .25in; font-family: Calibri; font-size: 11.0pt;\">The reversal of this command is the following:<\/p>\n<pre style=\"margin: 0in; margin-top: .25in; font-family: Calibri; font-size: 11.0pt;\">git update-index --no-assume-unchanged &lt;FILENAME&gt;<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ignoring files in git can be in the well known .gitignore file\u00a0or in the\u00a0.git\/info\/exclude file. What&#8217;s the difference between the two files? File Description .gitignore Operates at the repository level and everyone is sharing this file. .git\/info\/exclude Operates at the local working directory (i.e. normally the root of the cloned repository) level and only you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/242"}],"collection":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=242"}],"version-history":[{"count":3,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/242\/revisions"}],"predecessor-version":[{"id":245,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/242\/revisions\/245"}],"wp:attachment":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}