Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

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

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)


Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
Say goodbye to the hassles of bike ownership! MotoShare.in offers affordable rentals, whether you need a scooter for errands, a bike for a road trip, or a reliable ride to explore new cities.

Related Posts

What is Git and use cases of Git?

What is Git? Git is a distributed version control system (DVCS) planned to track changes in source code during software development. It was developed by Linus Torvalds…

Read More

What is GitOps?

GitOps is a modern approach to managing and automating the deployment and operation of applications and infrastructure using Git as the single source of truth. In GitOps,…

Read More

What is Git LFS and use cases of Git LFS?

What is Git LFS? Git LFS (Large File Storage) is an extension of the Git version control system that addresses the challenge of managing large files and…

Read More

How to Use GitOps for Agile Development?

Are you tired of traditional development methods that are slow and cumbersome? If so, you may want to consider GitOps for agile development. GitOps is a relatively…

Read More

How to Use GitOps for Continuous Integration?

Are you tired of constantly manually updating your application infrastructure? Do you want a more efficient way to manage your continuous integration process? Look no further than…

Read More

How to Use GitOps for Continuous Delivery?

Are you tired of manually deploying your applications and updates? Are you looking for a more efficient way to manage your software development process? Look no further…

Read More