We structure our git flow with two main branches: master and develop (which is a branch off master). When creating a new feature for our website, we make a branch from master, make our changes, then merge that branch (call it branch A) into develop for testing.
We have a deploy script in PHP that calls passthu("git pull 2>&1")
in order to pull changes onto our development server, which mimics our live server as much as possible. Our development server pulls these changes from the develop branch.
When we're happy with our changes on the development server, we merge branch A into the master branch and run the deploy script on our live server to apply our changes to the live site.
A coworker of mine merged two branches that he had made from master (B into C), and then merged the result into develop. He claims that Github was "acting strangely" after he ran the deploy script on the development server and decided to do a forced push of his own copy of develop in order to return the repository to its previous state.
Now, when trying to run the deploy script from the development server after making new changes and pushing them through our workflow as normal, I'm seeing "Please tell me who you are"
and "fatal: empty indent not allowed"
errors.
I tried to fix this by creating another script that ran passthru("git reset --soft 2>&1")
as this answer recommends, which removed those errors. Now, I'm seeing the following error after making any changes, telling me that git doesn't recognize the files in the repository:
"error: Your local changes to the following files would be overwritten by merge: Please, commit your changes or stash them before you can merge.
Aborting"
Attempting a rebase (git pull --rebase
or git rebase -i origin/develop
) gives me the same "Please tell me who you are"
and "fatal: empty indent not allowed"
errors.
I'm leaving a hard reset as a last resort. Is there anything else that I can try first that won't potentially cause major issues with our development site?