cd 'brew --prefix': no such file or directory &gt; cd 'brew --prefix'
-bash: cd: brew --prefix: No such file or directory


Additional errors:

&gt; brew update
fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

&gt; brew doctor
fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Error: undefined method `[]' for nil:NilClass
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/reporting-bugs
/usr/local/Library/Homebrew/cmd/doctor.rb:840:in `check_for_outdated_homebrew'
/usr/local/Library/Homebrew/extend/pathname.rb:310:in `cd'
/usr/local/Library/Homebrew/extend/pathname.rb:310:in `chdir'
/usr/local/Library/Homebrew/extend/pathname.rb:310:in `cd'
/usr/local/Library/Homebrew/cmd/doctor.rb:837:in `check_for_outdated_homebrew'
/usr/local/Library/Homebrew/cmd/doctor.rb:907:in `send'
/usr/local/Library/Homebrew/cmd/doctor.rb:907:in `doctor'
/usr/local/Library/Homebrew/cmd/doctor.rb:906:in `each'
/usr/local/Library/Homebrew/cmd/doctor.rb:906:in `doctor'
/usr/local/bin/brew:83:in `send'
/usr/local/bin/brew:83


Any ideas what's going on here?
To do your cd command, you need to use backticks, not the quotation mark (putting this in an answer because difficult to format)

cd `brew --prefix`


The backticks make the shell execute the command and return the value. (in this case brew --prefix transforms into the directory where homebrew is installed).  For example, in a very simple case:

cd `echo '..'`


Transforms into:

cd ..


Which goes up a directory.

It looks like something is wrong with the git repo for your homebrew install. If you haven't installed a  lot, might be easier to just uninstall and reinstall and try again. You should go to the docs for brew, but you can just rm -rf on your Cellar folder and have everything return to its original state.  More info here.