Cannot find FileMerge (opendiff tool) but I have xcode 4.6 installed - xcode

When I attempt to run FileMerge as a GUI for Opendiff, I receive an error:
$ git mergetool -t opendiff
Merging:
Gemfile
Gemfile.lock
...
Normal merge conflict for 'Gemfile':
{local}: modified file
{remote}: modified file
Hit return to start merge resolution tool (opendiff):
2013-12-26 20:00:20.248 opendiff[22367:e07] Couldn't find FileMerge
Gemfile seems unchanged.
Was the merge successful? [y/n] ^C
$
I have installed XCode 4.6.3 and Command Line Tools for Xcode April 2013. I am running OSX 10.7.5
I have tried solutions from the following two links with no success:
git diff with opendiff gives "Couldn't launch FileMerge" error
Is filemerge still available after Xcode 4.3 installation?
When I go to Xcode -> Open Developer Tool I do not see FileMerge in the list of options. There is a More Developer Tools link that takes me here: https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-
How do I get FileMerge working?

FileMerge is located at within Xcode.
From the command-line:
cd /Applications/Xcode.app/Contents/Applications/
open .
Go into that directory once it opens:
Right-click on the app
Choose "Make alias"
Move that alias to your Applications directory
You're all set.

Strange. "XCode 4.5, where is FileMerge ?" suggests:
The FileMerge that is bundled with Xcode 4.5 doesn't work as a standalone application. I tried compressing it from the application bundle. I was able to expand it to show the FileMerge app on the desktop. But when I tried to run it I got an error saying it couldn't be opened.
Apple's developer downloads site has every version of Xcode. You could try trashing your current version of Xcode 4.5, downloading Xcode 4.5 from the developer downloads site, and see if FileMerge is there. If not, you can download Xcode 4.4 and see if that has FileMerge.
Indeed, I downloaded a fresh new install of XCode 4.5 and put my updated 4.4 to 4.5 upgraded version into the trash and I have now all the developer tools again, including FileMerge. Weird...
The other option, from that same thread:
Why not just install the Command Line Tools? That will give you the "opendiff" tool. Then, you create a little script like this one to make it useful and actually do a merge.
#!/bin/sh
# Get a hold of the last parameter.
eval LAST=\${$#}
# Now run opendiff with the previous version and the current version.
opendiff ${*} -merge "$LAST"

if you have xcode installed, then you can probably run the following from the command line to open FileMerge directly
open /Applications/Xcode.app/Contents/Applications/FileMerge.app/

Try reinstalling Xcode. I had the same issue and it fixed it for me! It appears the Merge utility got corrupt somehow.

Related

during install pod i am getting this error

Failed to extract git version from git --version. Instead I see:
xcrun: error: active developer path ("/Users/mcbook/Downloads/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
Like all macOS apps, the Xcode app is represented in the file system as a folder, even though in Finder we see it as an icon.
In Xcode’s case its main app folder contains subdirectories that include some command line development tools that are necessary when installing apps that need to be compiled.
When you first run Xcode, it registers the location of this subfolder for you. Unfortunately, it looks like you first ran Xcode when it was still sitting in your Downloads folder, and so all your command line tools are still looking for it there.
I’m assuming that in the mean time you’ve moved Xcode – which, as you’d expect, moves all the application folder’s files and subfolders as well – to your /Applications folder.
You should be able to redirect all your tools to look in the new, correct location by using the following command line command:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Xcode and git-lfs

I installed git-lfs using homebrew, and it works fine from the command line. I can still add text files in Xcode as well, but whenever I try in Xcode to add a file which should be tracked by git-lfs, there is no effect (the file stays "?" in Xcode's file list, and the command line confirms that the file was not, in fact, added). After some research, I tried adding ~/Library/LaunchAgents/my.startup.plist to setenv PATH /usr/local/bin but it had no effect.
How can I get Xcode to play nice with git-lfs?
There seem to be a problem with using git-lfs with Xcode. See this article:
http://gopalkri.com/2016/05/17/git-lfs-xcode-asset-catalogs/
Might be better off to stick with Git to commit your changes instead of doing it via Xcode.
We have a similar issue, our CI uses Xcode's git and not the homebrew one. So we needed to get git-lfs working in Xcode. This proved pretty simple: copying the git-lfs core file from the homebrew version into Xcode (you need to do this again every time you upgrade Xcode):
sudo ln -s `which git-lfs` /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-lfs
Edited to highlight great improvement by #blackjack75.

FileMerge quits immediately after launching from SourceTree

I regularly use Atlassian SourceTree (on Mac OS X) to launch FileMerge to resolve git merge conflicts. Out of the blue it has stopped working: when I right click and select Resolve Conflicts > Launch External Merge Tool, FileMerge launches, creates its intermediate files, then immediately exits. SourceTree interprets that as the merge process being complete.
What's the issue and how can I debug/fix it?
I note that a previous question 'SourceTree filemerge quits immediately and creates 4 files. How to fix it?' does not address this particular scenario (for one, it says FileMerge quits in the title, but in the body it says FileMerge displays /dev/null as one of the panels. Additionally, my merge conflict is not due to a removed file.)
To diagnose the problem, I ran opendiff from the Terminal. I received the following error:
xcode-select: error: tool 'opendiff' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
To solve:
Open Xcode > Preferences > Locations
Click on the drop-down box beside Command Line Tools and select your current Xcode version. (This was empty for me because I had recently installed Xcode on a new Mac.)
Run opendiff in Terminal again, and the above error should no longer appear.
Now FileMerge will open correctly from SourceTree when you click Launch External Merge Tool.
For me, SourceTree didn't even launch FileMerge. When clicking Launch External Merge Tool nothing happened.
Moreover, running opendiff in Terminal worked as expected:
$ opendiff
opendiff[64176:5561154] too few arguments
opendiff[64176:5561154] usage: opendiff file1 file2 [-ancestor ancestorFile] [-merge mergeFile]
What helped me was manually configuring SourceTree to use FileMerge via the opendiff command with the following arguments: $LOCAL $REMOTE -ancestor $BASE -merge $MERGED
This way, SourceTree opens FileMerge as expected.
This helped:
https://gist.github.com/kylefox/4512777
Tell system when Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff
If Xcode has recently updated itself, you may need to agree to the new license terms. If you have not agreed to the license terms, FileMerge (when launched from SourceTree) will quit immediately.
To check for this, open a shell and run as your usual user:
$ opendiff
If the license is the problem, it will tell you. To agree to the new license terms, you'll need to run open diff using sudo:
$ sudo opendiff
After agreeing to the license terms, you can now retry launching FileMerge from SourceTree using Resolve Conflicts > Launch External Merge Tool. FileMerge should launch and behave normally.
This also works to resolve the message "xcode-select: error: tool 'opendiff' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance":
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
I have encountered this problem and solved it with the answer here
So this time, when I had it again, I thought the same issue happened...
And after trying for almost an hour, I've realized that the Diffmerge (or any external diff tool) did not open because there was no file in the current branch to merge.
This can happen when you do Cherry Pick where the commits can be jumpy. Added this answer to remind people who are going to have the same issue.
Tick Allow Sourcetree to modify your global... solves the issue for me

Can't commit/update file in Xcode editor (SVN)

I'm having problems with Xcode's built in SVN manager.
I checked out a remote SVN repository and I want to commit the changes while I'm working in Xcode's editor. As seen on the screenshot, it shows the correct SVN flag in the Organiser window and also in the editor sidebar (M for modified etc.), but when I try to commit from within the editor, I get the error:
The operation could not be performed because no valid working copies were found.
Although commiting/updating etc. works fine in the Organiser window…
Any ideas why?
I had this exact same issue recently.
The solution for me was a simple restart of Xcode, and after that all the files were noted as being updatable via the right click "Source Control >" menu.
I encountered this myself today when trying out Git with Xcode for the first time. I created two demo projects with the "create a local git repository" option and they had the same problem. I was able to commit from the organizer window, but the main Xcode file view didn't seem to recognize git at all.
After quitting and restarting, I created a third demo with the git option, and the main window recognized the changes right off the bat - i.e showed the "M" beside a modified file.
I think Xcode subversion version is different from repositary version.
if you use other svn management tools like "cornerstone", you have to check versions.
Check subversion's version on Terminal
1.xcode subversion
/Applications/Xcode.app/Contents/Developer/usr/bin/svn --version
2.installed subversion
/usr/bin/svn --version
3.port installed version
/opt/local/bin/svn --version
check these versions and upgrade Xcode's svn binary.
This is what i did.
$ cd /Applications/Xcode.app/Contents/Developer/usr/bin
$ mkdir svn_backup
$ mv svn* svn_backup/.
$ ln -s /opt/local/bin/svn* .
and restart Xcode.

How to install native assembler for Mac OSX?

I am interested to know how can I install native assemblar (I think also known as AS) on Mac OSX Lion. Someone suggested that I can use the Xcode to do it but I didn't see any options.Terminal windows is not able to recognize AS as command right now. Can someone provide more insight on this ? I am new to Mac/Unix environment so please provide help accordingly.
If you have Xcode installed, then you have as.There is no option to install specific packages from the Xcode installer.
as should be in /usr/bin/:
ls -l /usr/bin/as
If not, you probably have a problem with your Xcode installation.
Otherwise, also check your PATH environment variable, to ensure /usr/bin/ is in the list.
echo $PATH
If you've installed Xcode 4.3, it doesn't install the command line tools anymore. To get them, you have to launch Xcode, go to Xcode > Preferences... > Downloads tab, then click the 'Download' button for 'Command Line Tools'. You'll need to sign in with an Apple Developer ID.
Using Xcode 4.6 with Command Line Utilities installed
export PATH=/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH
as will execute along with the other command line utilities.

Resources