简体   繁体   中英

Trying to install git on OSX: cannont exec 'git-credential-osxkeychain': Permission denied`

I'm attempting to install Git on my new MBP and am following the documentation @ https://help.github.com/articles/set-up-git .

I seem to have hit a snag at the point where it says : If you do not have the helper, you can download it and copy it to /usr/local/bin

I navigated to /usr/local/bin in terminal and did a sudo wget [link to osxkeychain]. When I try to do a git config --global credential.helper osxkeychain I get a fatal: cannont exec 'git-credential-osxkeychain': Permission denied .

What did I do wrong?

Thanks!

Tre

Download the git-credential-osxkeychain file to your desktop(!).
Open the Terminal application.
Type in the following:

sudo cp  ~/Desktop/git-credential-osxkeychain /usr/local/bin/git-credential-osxkeychain  
sudo chmod 755 /usr/local/bin/git-credential-osxkeychain  
sudo git config --global credential.helper osxkeychain

Test it with:

sudo git credential-osxkeychain

See the sudo prefix? It seems to be required for the credential stuff... It should now output Usage: git credential-osxkeychain <get|store|erase>

使下载的文件可执行:

chmod 755 git-credential-osxkeychain

Homebrew 's git package sets this up; just:

brew install git

and you're away.

Tried sudo?

/usr/bin is protected. Or you could try downloading git executables somewhere on your laptop and add that location to your PATH.

One of the common mistakes made by people starting on git is that they have the wrong executable for the operating system.

Please make sure that when you go to git help setup page you click on the right link

for example the following link has MAC | WINDOWS | LINUX | ALL options in the top of the page which is small enough to be ignored by many.

  https://help.github.com/articles/set-up-git

This has happened to many of my team member to install osx for ubuntu and end up getting the error mentioned above

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM