2

I have git set up with the git-lfs extension. When using Xcode 6 to do a search and replace then it uses git internally to take a snapshot of the project before doing the replace. Now that I am using lfs the snapshot fails with the message:

error: copy-fd: write returned Broken pipe
error: cannot feed the input to external filter git lfs clean %f
error: external filter git lfs clean %f failed 1
error: external filter git lfs clean %f failed
fatal: xxxx: clean filter 'lfs' failed

Is it possible to configure Xcode to use the version of git with the lfs extension installed? Or update the version of git used by Xcode to add the lfs extension?

I tried installing git-lfs in the same directory as git used by Xcode but that does not help.

cp git-lfs /Applications/Xcode.app/Contents/Developer/usr/bin
combinatorial
  • 9,132
  • 4
  • 40
  • 58

1 Answers1

1

I'm guessing you've installed git-lfs via homebrew, so that it's in /usr/local/bin, and updated your PATH to match. The problem is that GUI apps don't inherit your updated PATH from the shell, because their parent process is launchd. So when Xcode tries to run git, Git fails because it can't locate git-lfs.

This answer talks about the various ways that OS X apps pick up their environment, and how you can modify the defaults in OS X 10.9 and earlier.

For Yosemite, it seems that /etc/launchd.conf is no longer supported, and so the fix is slightly different: https://apple.stackexchange.com/questions/106355/setting-the-system-wide-path-environment-variable-in-mavericks.

Community
  • 1
  • 1
brian sharon
  • 563
  • 4
  • 6