{"id":9675,"date":"2020-01-28T12:08:58","date_gmt":"2020-01-28T12:08:58","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9675"},"modified":"2021-11-13T06:08:04","modified_gmt":"2021-11-13T06:08:04","slug":"git-error-on-linux-how-do-i-remove-files-saying-old-mode-100644-new-mode-100755-from-unstaged-changes-in-git","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/git-error-on-linux-how-do-i-remove-files-saying-old-mode-100644-new-mode-100755-from-unstaged-changes-in-git\/","title":{"rendered":"Git Error: How do I remove files saying \u201cold mode 100644 new mode 100755\u201d from unstaged changes in Git?"},"content":{"rendered":"\n<p><strong>How I got this error:<\/strong><br>I had to take a pull in my project directory<br>I tried to take the pull by running the below commands<br><code><strong>cd &lt;My Project Directory&gt;<br>sudo git pull<\/strong><\/code><br><br>The outcome of the above command was:<br><\/p>\n\n\n\n<p><code><strong>root@ip-172-31-20-213:\/opt\/lampp\/htdocs\/sp-hospital-ms# sudo git pull<\/strong><br> remote: Counting objects: 7, done.<br> remote: Compressing objects: 100% (7\/7), done.<br> remote: Total 7 (delta 5), reused 0 (delta 0)<br> Unpacking objects: 100% (7\/7), done.<br> From bitbucket.org:surgeryplanet\/sp-hospital-ms<br>    6c3214b..bd047fe  master     -&gt; origin\/master<br> Updating 6c3214b..bd047fe<br> <strong>error: Your local changes to the following files would be overwritten by merge:<br>         app\/Http\/Controllers\/PassportApi\/QuoteManagementController.php<\/strong><br> Please commit your changes or stash them before you merge.<br> Aborting<br> root@ip-172-31-20-213:\/opt\/lampp\/htdocs\/sp-hospital-ms# sudo git pull -f<br> Updating 6c3214b..bd047fe<br> error: Your local changes to the following files would be overwritten by merge:<br>         app\/Http\/Controllers\/PassportApi\/QuoteManagementController.php<br> Please commit your changes or stash them before you merge.<br> Aborting<br> root@ip-172-31-20-213:\/opt\/lampp\/htdocs\/sp-hospital-ms# <br><\/code><br>As you can see it is telling me that I have some local changes in a file with name  <strong>QuoteManagementController.php<\/strong>. In fact there was no real local change to that file<br><br><strong>Then <\/strong>I tried to check the difference by issuing the command show below:<br><code><strong>git diff --unified=0 app  <\/strong>                                                                           <strong>\/Http\/Controllers\/PassportApi\/QuoteManagementController.php<\/strong><\/code><br><br><strong>The output was:<\/strong><br><code><strong>diff --git a\/app\/Http\/Controllers\/PassportApi\/QuoteManagementController.php b\/ap                                                                             p\/Http\/Controllers\/PassportApi\/QuoteManagementController.php<br> old mode 100644<br> new mode 100755<\/strong><\/code><\/p>\n\n\n\n<p><strong>Solution:<\/strong><br>Run the command given below in your project&#8217;s home directory:<br><code><strong>git config core.filemode false<\/strong><\/code><br>Then<br><code><strong>sudo git pull<\/strong><\/code> (only if you need to take the pull)<br><br><br><\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_81427\"><iframe loading=\"lazy\"  id=\"_ytid_90438\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_81427\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How I got this error:I had to take a pull in my project directoryI tried to take the pull by running the below commandscd &lt;My Project Directory&gt;sudo git pull The&#8230; <\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[38],"tags":[],"class_list":["post-9675","post","type-post","status-publish","format-standard","hentry","category-git"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=9675"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9675\/revisions"}],"predecessor-version":[{"id":24987,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9675\/revisions\/24987"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}