When trying to commit after a merge I\'m getting this error message:
<\"fatal: You are in the middle of a merge -- cannot amend.\"
If you are trying to amend on a previous commit and you know there will be merge conflicts then force push the changes (if you are sure that you want your current changes to override remote changes).
First commit:
1. git add test.txt
2. git commit -m "some changes"
3. git push
Second commit after some changes in same file which will result in merge conflict and we know we want only the latest changes that we did in this file:
1. git add test.txt
2. git commit --amend
3. git push -f
Otherwise, we might get stuck in merge and commit loop.