Slide 1
Excellent Education Program
Innovative Methods of Teaching

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cum sociis natoque penatibus et magnis dis parturient.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 3
Learning Through Play
Find a Class for your Children

Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis.

previous arrow
next arrow

Git Error: How do I remove files saying “old mode 100644 new mode 100755” from unstaged changes in Git?

Spread the Knowledge

How I got this error:
I had to take a pull in my project directory
I tried to take the pull by running the below commands
cd <My Project Directory>
sudo git pull


The outcome of the above command was:

root@ip-172-31-20-213:/opt/lampp/htdocs/sp-hospital-ms# sudo git pull
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 5), reused 0 (delta 0)
Unpacking objects: 100% (7/7), done.
From bitbucket.org:surgeryplanet/sp-hospital-ms
6c3214b..bd047fe master -> origin/master
Updating 6c3214b..bd047fe
error: Your local changes to the following files would be overwritten by merge:
app/Http/Controllers/PassportApi/QuoteManagementController.php

Please commit your changes or stash them before you merge.
Aborting
root@ip-172-31-20-213:/opt/lampp/htdocs/sp-hospital-ms# sudo git pull -f
Updating 6c3214b..bd047fe
error: Your local changes to the following files would be overwritten by merge:
app/Http/Controllers/PassportApi/QuoteManagementController.php
Please commit your changes or stash them before you merge.
Aborting
root@ip-172-31-20-213:/opt/lampp/htdocs/sp-hospital-ms#

As you can see it is telling me that I have some local changes in a file with name QuoteManagementController.php. In fact there was no real local change to that file

Then I tried to check the difference by issuing the command show below:
git diff --unified=0 app /Http/Controllers/PassportApi/QuoteManagementController.php

The output was:
diff --git a/app/Http/Controllers/PassportApi/QuoteManagementController.php b/ap p/Http/Controllers/PassportApi/QuoteManagementController.php
old mode 100644
new mode 100755

Solution:
Run the command given below in your project’s home directory:
git config core.filemode false
Then
sudo git pull (only if you need to take the pull)


Chetan