I think I've messed something up. When I try the following commands I always get “: No such file or directory“.

$ git stash list
: No such file or directory
$ git log
: No such file or directory
$ git diff
: No such file or directory

I tried reinstalling git and updated to mountain lion, searched in my .bash_profile and .bashrc, but nothing changed.

I hope you can help me fix it.

There is another problem. I don't know if this is related. For each blank line in my .bash_profile I get a : command not found. I commented them out and was fine.


The problem with your .bash_profile may well be related in case it contains e.g. something to manipulate your command prompt. It would get executed every time you type a command, regardless of the command.

What does "type git" give you? It should tell you the location of the git command. Does it do this for any commands other than git? What happens when you rename your .bash_profile to e.g. _bash_profile (effectively removing it). Do be sure you restart your terminal, it will only read the file on startup.

  • With your hint I found this little pice of code: export PAGER="less". I removed it and now everything works fine. Except from the new line problem, but this seems to be another problem. Thank you. – Carsten Griesheimer Nov 15 '12 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.