Could not symlink share/git-core/contrib /usr/local/share/git-core is not writable

I’ve really tried and used any suggestion from repairing, over uninstalling everything, to reinstalling, etc. but no solution works. I’m completely stuck and need help to find a solution! Thanks in advance, Christoph

MacBook-2:~ MyUserName$ brew install git
Warning: git-2.1.3 already installed, it's just not linked
MacBook-2:~ MyUserName$ brew destroy git
Error: Unknown command: destroy
MacBook-2:~ MyUserName$ brew uninstall git
Uninstalling /usr/local/Cellar/git/2.1.3...
MacBook-2:~ MyUserName$ brew install git
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-    2.1.3.yosemite.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/git-2.1.3.yosemite.bottle.tar.gz
==> Pouring git-2.1.3.yosemite.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
 /usr/local/bin/git-credential-osxkeychain

The 'contrib' directory has been installed to:
 /usr/local/share/git-core/contrib

Bash completion has been installed to:
 /usr/local/etc/bash_completion.d

zsh completion has been installed to:
 /usr/local/share/zsh/site-functions
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/git-core/contrib
 /usr/local/share/git-core is not writable.

You can try again using:
 brew link git
==> Summary
🍺  /usr/local/Cellar/git/2.1.3: 1342 files, 32M
MacBook-2:~ MyUserName$ brew link git
Linking /usr/local/Cellar/git/2.1.3... 
Error: Could not symlink share/git-core/contrib
 /usr/local/share/git-core is not writable.

  • Exporting the change log from a commit on GitHub
  • How do I use 'git rebase -i' to rebase all changes in a branch?
  • Git won't diff my main plugin file?
  • How to manage a project dependent on another project in Git?
  • GIT pre-receive hook
  • How to find a url for a local GIT repo
  • Is there any functionality in git to check multiple git repos under a directory?
  • git submodule modified files status
  • gitignore: Ignore all files in folder hierarchy except one specific filetype
  • What does this mean from a security perspective: “Caution: This repository is private but the published site will be public.”
  • Why doesn't `git diff` invoke external diff tool?
  • How do I programmatically simulate resolving a merge conflict with GitPython?
  • 2 Solutions collect form web for “Could not symlink share/git-core/contrib /usr/local/share/git-core is not writable”

    This is probably an error related to permissions.

    Try

    sudo chown -R $(whoami) /usr/local/share/
    

    or, if you only need this on the git-core path,

    sudo chown -R $(whoami) /usr/local/share/git-core 
    

    might be enough.

    Then run

    brew link git
    

    again.

    Maybe you use sudo to install some application before ,So the owner of dictionary /usr/local/share/ and /usr/local/lib become root

    run:

    sudo chown -R $(whoami) /usr/local/share/
    
    sudo chown -R $(whoami) /usr/local/lib
    

    and then run:

    brew link git
    
    Git Baby is a git and github fan, let's start git clone.