We have a git based project with a friend and one master branch. He made some changes to some files, I made changes to some other files, and we may, most probably did, make changes to a couple of the same files. He committed and pushed all of his changes to the repo. Then I went and committed my changes and tried to pull his changes. I was presented with a few conflicts which I mostly resolved in favor of his changes because they were files I did not change. Then when I tried to push, I got a fatal: cannot do a partial commit during a merge.
These are the screens I get.
What can I do? The project runs fine except that the main menu of the game isn't showing the images its supposed to, which are the ones he was working on and the class files he worked on, aside from a couple of other ones.
Use git-reset or git merge --abort to cancel a merge that had conflicts. Please note that all the changes will be reset, and this operation cannot be reverted, so make sure to commit or git-stash all your changes before you start a merge.
On the command line, a simple "git merge --abort" will do this for you. In case you've made a mistake while resolving a conflict and realize this only after completing the merge, you can still easily undo it: just roll back to the commit before the merge happened with "git reset --hard " and start over again.
An Automatic Merge Failure occurs whenever there are competing changes made to the same line by two developers, or when one developer is working on a file and another developer deletes it. Merge conflicts are relatively common whenever you commit. It is essential to identify and resolve conflicts.
This is a common frustrating situation:
mv .git/MERGE_HEAD .git/MERGE_HEAD_STUCK
Your problem should be half solved already, in some case you need to make a pull from the organizer:
Then you should be able to use Git again from Xcode, you will probably have to resolve some merge conflicts but at least this will be under Xcode and not on the terminal.
Note: Consider removing the .DS_Stores from your git repository
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With