2013-11-15 92 views
2

我有一個iPad應用程序(XCode 5,iOS 7,Git源代碼控制和故事板)。我有兩個(2)我正在開發的分支(App Store中的1.8.1和工作副本2.0.0)。如何修復Git合併衝突的斷點文件?

我對接下來的版本做了輕微的改動,並認爲XCode的源代碼控制會自動將合併爲的更改爲2.0.0。我想我錯了。所以我試圖用XCode的源代碼控制進行合併,這就是事情進展緩慢的地方......它進入了一個循環。所以,我殺了XCode,並重新啓動它。

現在,我正在嘗試使用SourceTree進行合併。它告訴我,我的工作副本(2.0.0)中有一個合併衝突。綜觀2.0.0構建,我看到:

 <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當我做了git的狀態,我得到如下:

# 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 

我的問題是:如何解決這樣我可以合併?

+1

要在處於合併衝突狀態時獲取文件的名稱,請運行'git status'。 – RyPeck

+0

@RyPeck我完成了git狀態並將結果發佈在原始問題中。我可以只刪除斷點文件嗎? – SpokaneDude

+0

這是一個理解xcode的人的問題。不是我! – RyPeck

回答

9

使用.gitignore可以從項目中排除斷點數據(請參閱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 
+0

當然,但這不是回答這個問題。我期望如何清理推送忽略文件以及如何清理緩存的git等。 – dang

0

來解決這個混帳指數(高速緩存)清除.gitignore所包含的所有文件:(MAC)

  1. 添加gitignore文件:

    • 從終端打開您的項目的文件夾,然後按$ touch .gitignore
    • 然後按命令:$ VI的.gitignore
    • 按字母:我
    • 每一行中添加文本忽略例如: PushFor.xcworkspace/xcuserdata/ tapaway.xcworkspace/xcuserdata /宕。 xcuserdatad/UserInterfaceState.xcuserstate tapaway.xcworkspace/xcuserdata/dang.xcuserdatad/xcdebugger/ tapaway.xcworkspace/xcuserdata/ 莢/ Pods.xcodeproj/xcuserdata/
    • 上的退出按鈕按鍵盤
    • 按$ :x(保存)
    • 檢查一切是你的終端上確定:$貓的.gitignore
  2. 現在按命令:$ git的ST和看到,你仍然有未跟蹤文件,儘管你只是把它們放在gitignore,所以這意味着你已經把它推到git以便修復它: -git --cashed(並在這裏複製文件)例如: git rm --cached Pods/Pods.xcodeproj/xcuserdata/dang.xcuserdatad/xcschemes/xcschememanagement.plist

現在提交併推送!