basename, sed, and tr not found while attempting pull


I'm running into an issue when I try to pull using SourceTree 1.6.1 on Mac OS X Lion. I receive the following errors:

/Applications/ line 77: basename: command not found

/Applications/ line 77: sed: command not found

/Applications/ line 222: uname: command not found

Each of the requested commandline apps are found on my system in /usr/bin (confirmed with which basename etc..).

Has anyone run across this problem, and if so how did you resolve it?


2 answers

1 accepted

0 votes
Accepted answer

Thanks for the help Steve. I have checked my .profile file and can't seem to locate anything out of the ordinary. My PATH always seems to end up including /usr/bin. I'm just using the absolute paths for now. It seems to have remedied the problem.

hey Marek. Pls post the answer here as well. I am also facing same issue while using intelliJ

The only way this could happen is if the PATH for Mac OS apps had been altered so that it no longer included /usr/bin. Note that the PATH that full .apps see is separate to that you see in a terminal.

The PATH is usually built up for .apps from the contents of /etc/paths and any files in /etc/paths.d. The contents of /etc/paths should be something like this on a standard install of OS X:


I can only assume that this file has been changed so that the standard paths aren't there any more?

Hi Steve,

Thanks for the reply. I looked in /etc/paths and I ahve the standard:


The only file in /etc/paths.d is titled 50-X11 and contains just the following:


To your knowledge, are there any other places that apps draw on in constructing their path?

I have currently modified the .sh files that were effected by the error to include the full paths to the commands so I can continue to work, but am curious what could be casuing the errors.

Thanks once again for your insight.


Hmm, no, that's the standard locations and that appears to be in order. I guess it would be worth checking your .profile just in case there's something there which is overriding the PATH, because actually the problem is not with the *direct* call that SourceTree makes, but with the nested calls that git is making, and if that has gone through /bin/sh then it would have read your ~/.profile file - so if that's overwriting your PATH then that could be a contender.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

690 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you