如何修复断点文件中发生冲突的Git合并? [英] How do I fix a Git merge with conflicts in breakpoint's file?
问题描述
我有一个iPad应用程序(XCode 5,iOS 7,Git源代码控制和Storyboard).我目前有两个(2)分支(在App Store中为1.8.1,在工作副本中为2.0.0).
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).
在下一个版本中,我对1.8.1进行了微小的更改,并认为XCode的源代码控制会自动将更改合并到2.0.0.我想我错了.因此,我尝试使用XCode的源代码控制进行合并,这就是事情的发展……它陷入了循环.因此,我杀死了XCode,然后重新启动它.
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.
现在,我正在尝试使用SourceTree进行合并.它告诉我我的工作副本中有合并冲突,该冲突为(2.0.0).查看2.0.0的版本,我看到了:
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:"
=======
更新,当我处于git状态时,会得到以下信息:
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?
推荐答案
使用 .gitignore
从项目中排除断点数据(请参见).
Use .gitignore
to exclude breakpoints data from your project (see Which Xcode project files can I 'exclude' from my git repo?).
然后,您需要使用 git rm -r --cached
git rm -r --cached .
git add .
git commit -m 'Removed all files that are in the .gitignore'
git push
这篇关于如何修复断点文件中发生冲突的Git合并?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!