Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xCode 4.5 git merge fails to commit or give errors

I have two branches that I am trying to merge in xCode 4.5. After I resolve the two conflicting files and press the "Merge" button, the merge screen disappears, no errors come up, and it looks like it is successful. But unlike my previous experience with xCode 4.4, nothing is actually committed. If I try to do a commit manually of all the changed files, it gives an error saying "fatal: cannot do a partial commit during a merge." There is no indication how to proceed within xCode.

Here is what I get if I do git status from the command line. The two "not staged for commit" files are the ones with conflicts I resolved in xCode. I know I can try the merge using a different tool, but I like the xCode utility and I'll be kind of bummed if it no longer works reliably. Anyone else seen and solved this problem?

# On branch ios6
# Changes to be committed:
#
#   modified:   Flurry/libFlurry.a
#   modified:   Network Commuting/Constants.h
#   modified:   Network Commuting/LegMapViewController.m
#   modified:   Network Commuting/Logging.h
#   modified:   Network Commuting/Nimbler Caltrain-Info.plist
#   modified:   Network Commuting/Plan.m
#   modified:   Network Commuting/PlanStore.m
#   modified:   Network Commuting/RouteDetailsViewController.h
#   modified:   Network Commuting/RouteDetailsViewController.m
#   modified:   Network Commuting/RouteOptionsViewController.m
#   modified:   Network Commuting/SettingInfoViewController.m
#   modified:   Network Commuting/TEXTConstant.h
#   renamed:    Network Commuting/TestFlightSDK1/TestFlight.h -> Network Commuting/TestFlightSDK1-1/TestFlight.h
#   new file:   Network Commuting/TestFlightSDK1-1/libTestFlight.a
#   deleted:    Network Commuting/TestFlightSDK1/README.txt
#   deleted:    Network Commuting/TestFlightSDK1/libTestFlight.a
#   deleted:    Network Commuting/TestFlightSDK1/release_notes.txt
#   modified:   Network Commuting/ToFromViewController.h
#   modified:   Network Commuting/ToFromViewController.m
#   modified:   Network Commuting/TransitCalendar.m
#   modified:   Network Commuting/nc_AppDelegate.h
#   modified:   Network Commuting/nc_AppDelegate.m
#   modified:   Network CommutingTests/Network_CommutingTests.h
#   modified:   Network CommutingTests/Network_CommutingTests.m
#   modified:   Nimbler Caltrain.xcodeproj/project.pbxproj
#   modified:   Nimbler Caltrain.xcodeproj/xcuserdata/apprikamac1.xcuserdatad/xcschemes/Nimbler CaltrainTests.xcscheme
#
# Unmerged paths:
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#   deleted by us:      Network Commuting/DateTimeViewController.xib
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   Network Commuting/ToFromViewController.m
#   modified:   Nimbler Caltrain.xcodeproj/project.pbxproj
#
like image 416
jcanfield55 Avatar asked Sep 23 '12 00:09

jcanfield55


1 Answers

I get this all the time, as there are 3 people coding the app. It seems to relate to a mix of file additions and deletions by various people but frankly not sure. Maybe a git guru will chime in here, but this is how I fix things.

First close the project in Xcode and quit Xcode, and in Terminal navigate to the root directory of your project. Run 'git add' for any conflicted files you had to correct (who came up with 'add' for this???).

Run 'git status' and insure all looks well.

Now for the magic incantation: git commit -i -m "hoping and praying" . - the magic option is -i - with it the commit always succeeds (for me).

Now you can restart Xcode and reopen the project.

like image 121
David H Avatar answered Oct 16 '22 13:10

David H