Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX 10.10 yosemite beta on git pull: git-sh-setup: No such file or directory

After upgrading to OSX 10.10 Yosemite Beta, running git pull is returning the following error:

/Library/Developer/CommandLineTools/usr/libexec/git-core/git-pull: line 11: git-sh-setup: No such file or directory

I've checked the referenced git-core directory and the git-sh-setup.sh is there.

Other git commands are working exactly as expected

like image 200
meghaphone Avatar asked Jun 03 '14 18:06

meghaphone


3 Answers

I think the cleanest solution for this for now is to change the initial command in your iTerm session to be

/usr/bin/login -f <your user name>

This fixes the issue for me.

A further data point for analysis of the issue: It seems that in 10.10, multiple copies of the PATH environment variable exist and subshells seem to prefer the second copy.

You can reproduce this by launching any cocoa application on the console as launched by iTerm. You'll get a warning that looks like this:

2014-06-04 19:23:09.859 gitx[14676:362580] *** -[NSProcessInfo environment]: Warning: duplicate definition for key 'PATH' found in environment -- subsequent definitions are ignored.  The first definition was '(the path I have configured in my shell)', the ignored definition is '/usr/bin:/bin:/usr/sbin:/sbin'.

I believe this to be a problem in 10.10 and not iTerm, but something iTerm is doing is causing it to manifest itself (this doesn't happen in Terminal.app)

Update: This is caused by iTerm doing "interesting" stuff to the environment. Update to the official release of iTerm 2.0 to make this problem go away.

like image 117
pilif Avatar answered Nov 20 '22 21:11

pilif


I believe this is a bug in iTerm when using zsh. They deliberately don't invoke /usr/bin/login, and they don't use execle to clear the environment variables like they should be.

like image 40
Jeremy Huddleston Sequoia Avatar answered Nov 20 '22 20:11

Jeremy Huddleston Sequoia


Downloading the newest version of iTerm2 fixed this for me!

like image 20
Marthyn Olthof Avatar answered Nov 20 '22 22:11

Marthyn Olthof