How to use git mergetool's filemerge - macos

The documentation is here: http://www.kernel.org/pub/software/scm/git/docs/git-mergetool.html
A handy guide is here: http://ryanflorence.com/git-for-beginners/
However, neither of them explain how to use mergetool's filemerge.
The guide I read says "I hit enter and FileMerge pops up and I deal with the conflicts:" but it doesn't mention how to "deal with the conflicts".
When I run:
git mergetool
:and then hit return as prompted, and the filemerge window opens showing all the merge conflicts, it only responds to the commands cmd+D and cmd+shift+D (which allow cycling through the conflicts). However, there doesn't seem to be a mention of how to, for each conflict, choose left/right/neither. The combo-box dropdown does not seem to do anything.
Have already looked at docs, guide, file system menu, and systematically pressed keys on the keyboard looking for a response =)

I haven't found any official documentation for it, but here's the understanding I got from trial and error:
There's a split view with your two options on the left and right. You can't edit either of those. There's also a bottom view which you can edit. You might need to pull up on the little circle in the middle of the bottom of the screen to expand that section.
For each conflict, click on the area in middle of the left/right split view and choose from the drop down in the lower right either "Choose Left" if the left is what you want or "Choose Right" if that is what you want. If neither option is good, click "Choose Neither" and edit it in the bottom section.
There's an arrow in the middle column that will show whether you've chosen left or right by pointing at it. If you've chosen neither, the arrow will disappear. All three views scroll together using the scroll bar on the far right screen.
When you're done, click File > Save Merge from the menubar.

Related

Where is the Xcode side by side code comparison option?

Since Xcode 13, code comparison default is no longer a side-by-side diff.
There must be a way of doing this still.
I am struggling to find the option!
Click on Code Review (the blue button on the screenshot), the one with one arrow to the left and the other one to the right (or in View Menu).
Then, on the second icon, select Side by Side Comparison instead of Inline Comparison (or in Editor Menu).
"Commits list" is at the bottom, on the bar with Enable Breakpoints, etc.
You can enable it quickly in the menu Editor > Side By Side Comparison.

Selection + middle mouse click no longer pasting in GitBash

I have no idea what happened but when I woke up this morning to start working, my selection + middle mouse button no longer pastes the selection.
This has always worked prior to today and the only thing I changed was added a time stamp in my C/Program Files/Git/etc/profile.d/git-prompt.sh. Unfortunately I did not check if the paste was working prior to this change, but I've since reverted it, thinking it might be the cause. Still nothing.
If I enable paste on the right mouse button from the options window, it works. Still, middle mouse click does nothing even though it is enabled and selected. See the screenshot
Any idea what may have happened or what I need to change to get the behavior to return? I can deal with the right click pasting, but muscle memory and working in Linux has me conditioned to use the middle mouse wheel click, so I will begrudgingly.
There are lots of "How to enable selection paste in Git Bash" I've found, but they all point to updating the options like shown in the screenshot and are not one bit helpful. Please do not mark this as a duplicate.
Thank you.

How to more easily "update all frames" in autolayout in Xcode7?

The "Update Frames" calls are often grayed-out in Xcode
the only way I know to have it update frames to match your constraints, is, tediously select your highest-level view and than (sometimes) you can fish in the menu bar for "Selected Views"->"Update Frames". Further, "All Views"->"Update Frames" would appear to often simply not work or work in a way I can't understand.
Surely there's just a keystroke or button which updates all frames straight away to match any newly-entered constraints (such as those made using control-drag).
Note .. for 2016 you can use this very handy button, which at least brings up the same sub-menu as you can find by searching in the menu bar menu.
However it would seem (see my comments w/ ZaBlanc below) that there is perhaps actually an Xcode bug, and you CAN NOT assign a keystroke to the "All Views" items. (The ones you usually use.)
Even worse .. in Xcode 8 ...
they seem to have removed the 'update frames' option ... WTH
It's easy. Go to Preferences -> Key Bindings. Type "Update Frames" on the top. You'll see two appear. You'll want the bottom one (it will be the one without a keyboard shortcut assigned.)
Assign it to ⌘= or anything else you like.
Life changed.
Just for anyone reading, with Xcode 8.3. The popup menu command no longer exists. The menu bar command Editor -> Update Frames does work. However there's a bug, the default key binding on that does not work. If you add a custom key combo, that custom key combo does work.
AFAIK, there is no keystroke for update all frames, but here's a key tip:
If you have a misplaced views, press the yellow arrow in the document outline (the views tree to the left of canvas), press yellow triangle on any view in the list, then select update frames and check Apply to all views in container - this will update all misplaced views in the selected view controller
Additionally, you probably already know:
You can add a new constraint with Add New Constraints button in canvas bottom right and select "Update frames" option.
You can select any view by mouse-click and holding Option+Shift keys - this will show you the list of all the views, that intersects with mouse pointer. After that you can select update frames menu item on a selected misplaced view.
The same as you, I thought that it's very annoying to fix the misplaced views manually by selecting them and choose that boring option from Xcode menu. After trying hard to shorten the time to fix the layout issues, I had to admit that there is no way to call the function "Update Frames" from command line. So I ended up doing this way:
Open Xcode warnings & error inspector window
Filter all layout warnings by using the keyword "frame for"
Click on warnings to quickly locate to the misplaced views then press Command + Option + =
That's the fastest way I know. Please try it out!
You could also find more details HERE

how to come back when you are reading code in Xcode?

I have been developing in zend studio and there is a feature I miss a lot in Xcode. When you are reading code in a main function and you want to go in a specific function to read something, you can click in the left area of your current line of code were your are, and a flag-mark appears in that line of code, so you can go anywere else in the code and it will be very easy to come back to that line of code you were before because there is a flag and you only have to click on it and you automatically go back. Does Anybody know a similar way to do this in Xcode?
Unfortunately, this feature was present in earlier versions of Xcode (up to Xcode3 IIRC) and was called "Bookmarks", but it was removed since then.
You can use breakpoints (and disable them) as a workaround, even if it's not perfect. I personally prefer using other tricks, like "Open Quickly" and named tabs.
Alternate trick 1 : "Open Quickly"
One trick is to use Command+Shift+O (or "File" menu > "Open Quickly") to quickly open a file. In the field that appears, you can type:
The name or parts of the name of a file.
Typing "MainViewController" will propose to jump to the MainViewController.h or MainViewController.m file.
Typing "MainVC" will work too, as well as "MainViewCtrl", as long as the order of the letters you type is the same as the full name.
Very handy to just type "ContTVCell" to open the ContactsTableViewCell.h file that is hidden deep in subgroups of my project for example
Similarly, you may also type the name or parts of the name of a symbol, especially a method name.
For example, typing tvcellforrow will list you all the definitions of -tableView:cellForRowAtIndexPath: it could find in your project and let to jump to the one you want
When typing (parts of) the name of a file, adding : followed by a number at the end will allow you to directly jump at the corresponding line
For example, typing mvc:50 will propose you to jump to line 50 of MainViewController.h or MainViewController.m
Another trick : using (named) tabs
Don't forget that you can open tabs in Xcode, which can be very handy in this kind of situation.
When you are editing a file at some interesting position, you can create a new tab to browse elsewhere and go at any other place… and then go back to your first tab to find the code where you left it at the time you switched to the other tab.
Don't forget that you can name your tabs (simply double-click on their title) to give them a more explicit title. You may then quite think of them as "named bookmarks" somehow
Likewise, don't forget that you can detach tabs in separate windows too, if you prefer (for example to keep them around and visible on your secondary screen while you edit another part of your code)
You can even combine this with the "Open Quickly" trick presented above: once you made the "Open Quickly" field appear and typed something into it, instead of just validating using the enter key:
use Alt+Shift+enter to let Xcode present you a small widget that let you choose where you want the file to open (in the current tab, in another tab, in the assistant editor, in a dedicated window…)
use Alt+enter to open the file using the alternate navigation defined in Xcode preferences (Xcode > Preferences > Navigation > Optional Navigation). By default, the behavior when opening a file while using the Alt key is to open the file in the Assistant Editor. Personally I changed that in my Xcode preferences as I prefer to make Xcode open the file in a separate tab instead, which makes Alt+clic much more useful.
Sure, all those tricks with "Open Quickly…" and "Tabs" do not replace the bookmarks feature that you are missing. But they are still nice alternate ways to jump quickly to any position in your code, even any specific line of any specific file in your project, wherever you are in Xcode (even without having to have the Project Navigator visible on the left part of your window), and let you have multiple editors in different tabs to go quickly back to a part of interest in your code
its on top of your editor i have added two pics just check them.
When you navigate to another place in Xcode, say, open a different file, or Command-click and jump to definition, you can go forward and back by swiping right or left on the trackpad with two fingers.
You can also use keyboard shortcuts: Ctrl+⌘+→ to go forward, or Ctrl+⌘+← to go back.
Finally, you can click triangular buttons at the top left in your edit area.
There is a go back button at the top left of the editor!
If that is not good enough, whar I do is misuse breakpoints to set flags in my code. The breakpoint navigator thus becomes a table of flags. It isn't much but there you are.

Is there any way to scroll beyond the last line in xcode?

I ask if there is any way to scroll beyond the last line in xcode, because I always end up pressing a lot of enters to the end of my files, so that I don't have to always type my code at the bottom of my window.
I have skimmed through the properties panel of XCode, and had a look at this forum. So far the answer looks negative, but I kept my hopes up. :)
Any ideas for tricking XCode to scroll beyond the last line? (I have XCode 4.5.2)
There is now a plugin for that !
Have a look at SCXcodeEditorInset !
Dont think there is a way to do this but if you are trying to edit the buttom of the code while having it near the top of your display, you can click the middle view button in xcode to bring up the console/watcher and then drag that up to the desirable spot. This does decrease the overall space of your editor but can sometimes be useful if you prefer this or just need to do that temporarily
What I do is, When you finished typing at the bottom, before you go to top, type some unnecessary code "asdf" as error then go where you want. you can come back clicking on top right red error panel.

Resources