4

我正在运行 mac osx lion。

我的问题是在我输入每个命令后 git 挂起。

如果我输入git然后我得到Usage: git credential-osxkeychain <get|store|erase>

当我尝试输入其他内容时,例如git status终端只是挂起,但是一旦我再次按 Enter 键,它就会返回到正常的终端提示符,但命令永远不会通过。

我如何让 git 工作?

4

2 回答 2

3

似乎与您安装 git 的特定方法一样,您可能需要遵循以下说明: https ://help.github.com/articles/set-up-git

# Test for the cred helper
git credential-osxkeychain

# Download the helper
curl -s -O \
  http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain

# Fix the permissions on the file so it can be run
chmod u+x git-credential-osxkeychain

# Now you need to install the helper into the 
# same directory where Git itself is installed.

# Find where git is installed
which git

# Move the file to the path `which git` returned so git can access it
sudo mv git-credential-osxkeychain /usr/local/git/bin/

# Set git to use the osxkeychain credential helper
git config --global credential.helper osxkeychain

就个人而言,我只是使用homebrew它,它就像brew install git

于 2012-12-12T01:42:42.180 回答
1

我遇到过同样的问题。我相信 Jdi 的答案已经过时,因为它对我不起作用。

我的解决方案是重新安装 git

brew uninstall git
brew install git
git config --global credential.helper osxkeychain
git push

Git 提示我输入我输入的用户名和密码。为了检查它是否有效,我再次运行 git push 并且它没有要求我提供凭据,世界再次一切都很好:)。

于 2018-01-07T01:47:09.900 回答