gitgit-ftp

git ftp push overwrite error. Tried stashing, force pulling, force pushing, no luck


I'm having a problem where git won't let me push, giving me the "error: Your local changes to the following files would be overwritten by merge".

When I do a git pull it says that everything is up to date. When I run git status it says "nothing to commit, working tree clean." However, I have a file I've made changes in so when I try to push it, it gives me the error described above. The file that git references when it throws the error is not the file that I'm trying to push.

Some details:

Our git is set up to push to our dev site. So when we're working on a site, we are working on the master branch for the dev site. When a file is pushed, the git pushes the file to the site's server via FTP.

I suspect that this problem originated when one of our interns uploaded a file to the server for our dev site via WinSCP, not pushing it to the git and therefore causing problems. The file that they uploaded this way is the file git specifies when it throws the error.

I've tried solving this issue with stashing to no avail. The error says "Please, commit your changes or stash them before you can merge." git status brings up nothing that needs committing. I've tried to force a push and a pull and still get the error when I try to push a change.

Any input would be appreciated.

Thanks


Solution

  • After an unreasonable amount of trial and error I was able to fix it by doing a hard reset back to a commit from a week ago. Then I did a forced push and the problem went away