All of this was performed in Xcode and not terminal. I branched main to create the development branch. On development, I made a few tweaks and instead of committing them, I amended them. Now, when I attempt to merge development into main, I’m met with the error "no merge base found (-3)".
If instead of amending the changes, I commit them, there is no error. Should I have committed the changes instead of amending them to prevent this error? And did I receive this error as a fault of my own or should Xcode have been able to perform this merge?
>Solution :
Say git log development to learn the SHA of the amended commit (i.e. after it was amended) and say
git switch main
git rebase --hard <the-SHA>
This will point main at the same commit you amended. You will then be able to merge development into main (although there will be little point in doing so, because as far as I can tell from your question they are the same commit; either that or you’ll get a fast-forward, if you did more stuff than you have revealed in your question).