-2

I wanted to revert my local repo to my last GitHub commit, so I downloaded my GitHub repo and overwrote my local repo with the one I downloaded. I then made changes and tried to commit. When I tried git push -u origin master, I got the error message "Updates were rejected because the remote contains work that you do not have locally."

Then I did a git pull origin master which seemed to auto-merge all of my files except .htaccess, for which I received the error message "Automatic merge failed; fix conflicts and then commit the result."

I then did a force commit git push -f origin master and now when I load my index.php in a browser it reads "HEAD merged common ancestors" across the top of the page. When I run git status in the terminal it reads "On branch master You have unmerged paths. (fix conflicts and run "git commit")"

How do I fix conflicts and rid myself of the error message at the top of my page? Repo is at https://github.com/avashije/music

Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680
avashije
  • 1
  • 1

1 Answers1

0

You should be able to do a reset using the remote branch.

git fetch
git reset --hard origin/{branch name}

similar to this question.

Community
  • 1
  • 1
Keif Kraken
  • 9,500
  • 1
  • 10
  • 12