SpokaneDude SpokaneDude - 3 months ago 12
Git Question

How do I fix a Git merge with conflicts in breakpoint's file?

I have an iPad app (XCode 5, iOS 7, Git source control and Storyboards). I have two (2) branches I'm currently working on (1.8.1 in the App Store, and 2.0.0 as the working copy).

I made a slight change to 1.8.1 for the next release and thought XCode's source control would automatically merge the changes into 2.0.0. I guess I was wrong. So I attempted to do the merge using XCode's source control, and that's where things went downhill... it went into a loop. So, I killed XCode, and restarted it.

Now, I am attempting to do the merge using SourceTree. It tells me I have a merge conflict in my working copy which is (2.0.0). Looking at a build of 2.0.0, I see this:

<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "saori/CalendarViewController.m"
timestampString = "404851038.443273"
<<<<<<< HEAD <---------------- merge conflict
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "205"
endingLineNumber = "205"
landmarkName = "-viewDidLoad"
=======
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "205"
endingLineNumber = "205"
landmarkName = "-viewDidLoad"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "saori/SubViewData.m"
timestampString = "406167919.038573"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "221"
endingLineNumber = "221"
landmarkName = "-drawRect:"
>>>>>>> 1.8.1
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
<<<<<<< HEAD <------- merge conflict
filePath = "saori/SubViewData.m"
timestampString = "406167919.038573"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "221"
endingLineNumber = "221"
landmarkName = "-drawRect:"
=======


UPDATE When I do a git status, I get the following:

# On branch 2.0.0
# You have unmerged paths.
# (fix conflicts and run "git commit")
#
# Changes to be committed:
#
# new file: Resized Images/MainStoryboard.strings
# modified: saori/AppDelegate.h
# modified: saori/AppDelegate.m
#
# Unmerged paths:
# (use "git add <file>..." to mark resolution)
#
# both modified: SalonBook.xcodeproj/project.xcworkspace/xcuserdata/rolfmarsh.xcuserdatad/UserInterfaceState.xcuserstate
# both modified: SalonBook.xcodeproj/xcuserdata/rolfmarsh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# Crashlytics.framework/Versions/Current
# SalonBook.xcodeproj/xcuserdata/rolfmarsh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist.BACKUP.5744.xcbkptlist
# SalonBook.xcodeproj/xcuserdata/rolfmarsh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist.BASE.5744.xcbkptlist
# SalonBook.xcodeproj/xcuserdata/rolfmarsh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist.LOCAL.5744.xcbkptlist
# SalonBook.xcodeproj/xcuserdata/rolfmarsh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist.REMOTE.5744.xcbkptlist


My question is: how do I fix this so I can do the merge?

Answer

Use .gitignore to exclude breakpoints data from your project (see Which Xcode project files can I 'exclude' from my git repo?).

You will then need to clear all files that are included in .gitignore from the git index (cache) (documentation) using git rm -r --cached

git rm -r --cached .
git add .
git commit -m 'Removed all files that are in the .gitignore'
git push