How do I resolve git saying Commit your changes or stash them before you can merge

0 votes

I made some changes to my local machine and pushed it to the remote repository. I am getting this message while trying to pull the changes to the server.

error: Your local changes to the following files would be overwritten by merge:
wp-content/w3tc-config/master.php
Please, commit your changes or stash them before you can merge.

I tried solving it by running:

git checkout -- wp-content/w3tc-config/master.php

But I still get this message. I just want to merge the rest of my changes (plugin updates). I'm assuming that w3tc changed something in the config file on the server. Can someone help me with this?

May 13, 2022 in Git & GitHub by Kichu
• 19,040 points
1,157 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Git & GitHub

0 votes
1 answer

Please: Commit your changes or stash them before you can merge in Git.

Hi@akhtar, You can't merge with local modifications. Git ...READ MORE

answered Jan 4, 2021 in Git & GitHub by MD
• 95,460 points
19,144 views
0 votes
0 answers

How do I use git reset --hard HEAD to revert to a previous commit

When I revert this commit: git reset --hard ...READ MORE

May 15, 2022 in Git & GitHub by Kichu
• 19,040 points
876 views
0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,890 points
2,458 views
0 votes
1 answer

How do I solve a Git checkout error: updating paths is incompatible with switching branches?

This error occurs when you are checking ...READ MORE

answered Jul 26, 2018 in Git & GitHub by Sophie may
• 10,620 points
10,529 views
0 votes
1 answer

How do I install Git on windows?

Hey @Akash, follow these steps: Go to this ...READ MORE

answered Feb 19, 2019 in Git & GitHub by Nikhil
992 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,039 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP