ハマったので自分用のメモ
現状
Automatic merge failed; fix conflicts and then commit the result.
Git不慣れなので
作業ブランチの変更をmergeしようとしたら
以前に作業ブランチを作らずにmasterで作業をしてcommitした差分(馬鹿俺!!)があり
コンフリクトしたようです
そしてコンフリクト解消後にpushすると今度はリモートにも間違ったcommitがあり
Your branch is behind 'xxxx/xxxxx' by 1 commit, and can be fast-forwarded.
とか言われる
つまり
ローカルにもリモートにも
masterブランチに不要なコミットがありコンフリクトしている
解決方法
git log
不要なコミットのidを確認
git revert <不要なコミットのid>
これでローカルのmasterブランチから不要なコミットが消える
git push
これでリモートのmasterブランチから不要なコミットが消える
git merge <作業したブランチ>
不要なコミットがなくなったのでmergeが成功する
git push
不要なコミットがなくなったリモートにpush