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

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!

Related

Can't see listing of files in my commit

For some reason, source tree does not show the listing of files in my commit. I am on the "Workspace->History" view, It's set to "All Branches", "Show Remote Branches" and "Ancestral Order".
The tree shows up fine.
Under that, it shows me commit description, SHA1, parents, author, date, labels. On the right, it shows me only the diff of only one of files in the commit.
If I drag up the lower border, I can see the Command History.
If I create and stage new files, I do see them appear in the lower portion of the view in "Staged files" and "Unstaged files", and I can click on each file, and the diff on the right shows the differences. But once I commit, I can no longer see the file listing.
I know that all the files are committed as I see them in ls-files, it seems like I'm missing an option or preference somewhere in the tool. Anyone know what I'm referring to?
Wow. I did not realize there was a table with "Filename / Path" headers. On a mac at least, you can resize the contents of the table to a 0 height, so that it completely disappears and there is no way to bring it back without hovering over with a mouse.

Xcode merge two branch Git

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.

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.

How do I switch between the header and implementation file in Xcode 4?

How do I switch between the header and implementation file in Xcode 4?
In XCode 3 it was cmd and right or left (I think)
Ctrl+Cmd+Up or Down, but the shortcut seems a bit finicky and sometimes stops working, not yet sure when and why.
Be sure to FIRST click ON the actual code window...
that's the critical tip to ensure it works. Click anywhere at all on the actual code. (If you're active in one of the other many panes of Xcode, the keystroke combo has no, or different, meaning(s).)
Also, you can 3 finger swipe up and down on the touchpad if you have one.
Ctrl+Cmd+Up or Down
The shortcut sometimes stops working!!
The menu option has moved to "Navigate->Jump to Next Counterpart" and "Navigate->Jump to Previous Counterpart".
In preferences the key binding is now under "Jump to Next Counterpart" and "Jump to Previous Counterpart".
Why Apple insist on changing the menu positions AND names of these things is beyond me! I mean "Counterpart"!?
Worth nothing that Ctrl+Cmd+Left or Right move between previous and next files that were viewed (I mean "counterparts") too. These are also under the key bindings "Jump to Next Counterpart" & "Jump to Previous Counterpart").
The reason the menu option has been split between:
"Navigate->Jump to Next Counterpart" and "Navigate->Jump to Previous Counterpart"
is because you can have more than just one header file and one source file with the same file name. Besides having matching .xib files for view controllers, I have separate .vsh and .fsh files for vertex and fragment shaders in my OpenGL program. Along with my .h and .cpp files that's a list of 4 files that I can navigate up or down through with one key binding, instead of hitting the same key binding 3 times in a row to cycle back from file 2 to file 1.
Also in Xcode 6.1/7.1 shortucts are the same:
Jump to next counterpart:
Ctrl+Cmd+Up
Jum to previous counterpart:
Ctrl+Cmd+Down
Personally, coming from eclipse, I change this shortcut with:
Ctrl+Tab
this combination insn't already binded to anything else.
Xcode -> Preferences -> Key Bindings
search for "Jump to next counterpart" and put the new keys combination.
PRO
This is more efficient than default bindings see that you can use one hand instead of two!
"but the shortcut seems a bit finicky and sometimes stops working, not yet sure when and why."
Sometimes Xcode loses track of which .m and .h belong together. This is e.g. the case
when you open one of the files directly from the Finder. When you open the file from
the file list in Xcode, it normally works okay. Although when you have moved files between
folders & groups in the file list of Xcode, it will also list the relation between the files.
The command to swap between m and h files is CTL-CMD-up/down. It sometimes get stuck. To unstick it simply save the file, i.e. CMD-S, and the hotkey should work again.

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