Xcode merge two branch Git - xcode

I have two branch and they are called as NewFeature1 and subFun100. subFun100 is a branch created from previous commit in NewFeature1. Now, I have fixed code in subFun100 and I want to merge back into NewFeature1 branch. But, I have conflict like this. I just want to take both codes and how shall I do? Merge button is hidden and I can't click. Is there any step I am missing?

Merging Two Branches from developer apple.
3 . Resolve differences by using the left and right buttons to specify which file’s contents to use.
4 . After resolving all differences and conflicts, click Merge.
Use these 4 buttons. (red circle)
How To Use Git Source Control with Xcode in iOS 7

You need to resolve each conflict, choosing either left, right or both.
Only then you can complete the merge.

Related

Merge Conflicts Cannot see "?" in xcode

I am trying to merge between Branch 1 and Branch 2, so during merge there was a some conflicts but problem i cannot resolve the conflicts because it is not showing ? arrow in the middle of two branches where i can choose which one i can select right or left. Is this a xcode bug

xcode: resolve merge conflicts failed

I try to merge two branches with Xcode. I get conflict, and I use "let then right" button to reconcile conflict. But when I click "merge", Xcode shows the error
fatal: You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you merge.
Here is the screenshot
The four icons at the bottom mean this:
left then right - keep both changes, placing the left code before the right
left - keep only the left file
right - keep only the right file
right then left - keep both changes, placing the right code before the left
You chose "left then right" as you stated. However, I see that in your code both files have <outlet property="bottomView"> and <outlet property="finishSuiDuButton"> line which will result in duplicate code after merge, since the code from both files will be included. It looks to me like the option you actually want is option 2 - keep only the left file.
Either that or remove the duplicate code from one of the files and you should be good. :)

How do I go to the next conflict in the Xcode merge tool?

When I choose to merge a git branch into another via Xcode 5, I get an interface that shows me all the files that are going to be changed including those with conflicts. Before I go ahead with the merge, I am supposed to click on each file with a red C and fix the conflicts.
Imagine one of the files has 100 changes and only 3 of them are in conflict. How can I easily jump to the next conflict in the file? (Besides either manually scrolling and looking for something red, or by tapping the next arrow button 100 times.)
Update: This is specifically referring to the merge window you access by invoking the Source Control > (working copy) > Merge to/from branch command which displays a window such as:
(image source)
You can do it by pressing
cmd + D for next conflict
cmd + shift + D for previous conflict
Arrow keys!
Down arrow to go to the next issue, left and right keys to chose the code. You may need to click on the frame between your two sources to enter this mode.

Merging xcode repositories on Xcode: getting rid of C's

I am trying to merge a new version into the release branch. I got about 38 conflicts and I sort of get rid of them by selecting the file and clicking the third button at the bottom center saying to use the right file for the merge.
Yet there are three files left: a .xib, the project.pbxproj and a normal .m file that whatever button I push the red C does not disappear and the merge button remains dimmed.
What must I do to also merge those files and thereafter merge the whole project?
Thanks,
Fabrizio
File by file with a lot of work I fixed it. Surely if each time I need to merge two files I need an evening work, that is not a nice operation to execute!

How do you do a 3-way merge in FileMerge?

I see the option for specifying three files (left, right, and ancestor), but it doesn't seem to be possible to actually display the ancestor.
The bottom pane shows the result of the merge. I'd rather see what the original content was, so I could understand the context for the left and right sides of the conflict. Is this possible? FileMerge has awful help documentation.
Looks like in version 2.5 they have finally added this feature. "Ancestor" now actually means "Ancestor" and there is a separate "merge" option
From the command line you can do something like this:
$ opendiff mine theirs --ancestor base
Where "mine" is my version of the file, "theirs" is the version I'm trying to merge with, and "base" is the common ancestor of "mine" and "theirs.
This command will open File Merge and show the ancestor at the bottom (where the merge is in my example from 2010).
Unfortunately, it's not possible to use the --merge option along with the --ancestor option. So you can't view a three-way merge AND use File Merge to resolve the conflicts at the same time.
I am starting to use File Merge for viewing and understanding the conflict, then editing the conflict markers in a text editor as usual. (sigh...)
To my knowledge, this is not possible with filemerge.
Paid (but very good) app: http://www.deltopia.com/
Open source: http://sourcegear.com/diffmerge/
#mehaase:
That is not exactly correct. Here is the documentation on the new ancestor option from FileMerge Help:
Sometimes, you need to compare two versions of a file that have been modified
independently. For example, say two people branch a file; that is, they make
copies of a file and modify it. In this case, specify an ancestor file, which
is the common ancestor of the modified files.
The ancestor file lets FileMerge choose when to take changes from the left
file or the right file. For example, say the left file and the right file
contain a different version of line 33. If line 33 in the ancestor matches
line 33 in the left file, you know the change happened after the two files
branched off, and FileMerge prefers the newer version of line 33 in the right
file. If line 33 is different among the three files, you know that the files’
editors edited the lines separately. FileMerge displays that difference with
a red border and asks you to choose with edit to use.
So the ancestor is still not displayed, but it helps the merge tool to make a little more informed decisions when it decides to choose the left or right sides by default.
I realise this answer technically doesn't answer the question on how to do it with FileMerge, but I use kdiff3 (available for Windows, Mac and *nix) and it shows the base/ancestor, plus left and right, plus output/result, for a 3-way merge. (http://kdiff3.sourceforge.net/)
It's not a pretty user interface, but (IMHO) it's fairly simple to use and works well. And it's open source. :-)

Resources