I'm following Luke Jones' article on setting up a local server, and I'm currently trying to set up homebrew with git on Mavericks. I already had git installed before installing homebrew. I'm having an issue that seemed similar to this question but when I tried running brew link git
I received the following error:
Error: Could not symlink file: /usr/local/Cellar/git/1.8.5.1/share/git-core/templates/info/exclude
Target /usr/local/share/git-core/templates/info/exclude already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
brew link --overwrite formula_name
To list all files that would be deleted:
brew link --overwrite --dry-run formula_name
My /etc/paths
:
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
which git
returns /usr/bin/git
which brew
returns /usr/local/bin/brew
Not sure what the issue is, as I'm still not great at finding my way around things like this. Anyone know next steps to take?
For others having an issue in the future:
I have git linked with homebrew now. I had the Mac Github client installed which may have been making some files unwriteable (this post tipped me off), so I uninstalled that with AppCleaner, restarted my terminal, uninstalled all versions of git, ran sudo brew prune
to clean things up, and reinstalled git through brew with brew install git
. Then I ran brew link git
and it worked just fine.
I'm sure someone else might have a better explanation of what happened, and some of these steps might have been overkill, but it worked for me!
Try overriding the links as suggested in the error message:
brew link --overwrite git
You may add --dry-run
to check it first before doing any changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With