Homebrew – Homebrew Won’t Link Git

bashgithomebrewmacosterminal

I am trying to enable autocomplete for git on my mac (currently running El Capitan) but I am having troubles with Homebrew.

So far, I have installed bash-completion and added the lines in my bash_profile, as seen in this post The problem comes when doing brew install git (although there must be another git installed in my machine sin I have used it).

After reinstalling brew, I get that git is installed but it's not link:

Warning: git-2.7.3 already installed, it's just not linked

I try using the command brew link git and I get this:

Linking /usr/local/Cellar/git/2.7.3... 
Error: Could not symlink share/git-core/contrib
/usr/local/share/git-core is not writable.

Have anybody faced this situation before? How can I link git and what's exactly the "linking" problem?

Best Answer

I used brew doctor to see what's was happening.. It seems like there were some broken links.

The solution: I unlinked them, then I was able to run brew link git successfully. And now auto-completion works fine