4

I am running mac osx lion.

My problem is that git hangs after I type in each command.

If i type in git then I get Usage: git credential-osxkeychain <get|store|erase>

When I try to type in something else, for example git status the terminal just hangs, but once I hit enter again, then it goes back to the normal terminal prompt, but the command never goes through.

How do I get git to work?

Nevik Rehnel
  • 49,633
  • 6
  • 60
  • 50
areke
  • 1,093
  • 1
  • 14
  • 23

2 Answers2

4

Seems with your specific approach to installing git, you might want to follow these instructions: 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

Personally, I just use homebrew and its as easy as brew install git

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
jdi
  • 90,542
  • 19
  • 167
  • 203
  • 3
    When I do `git config --global credential.helper osxkeychain` it still hangs. – areke Dec 12 '12 at 03:07
  • I just installed it and then reinstalled it, which worked. :) I'm gonna accept this since you took the time to answer. Thanks! – areke Dec 12 '12 at 03:28
  • Glad to hear you figured it out! Sorry that I couldn't take you all the way through the process. It had to be something strange like that, where something didn't get installed properly. – jdi Dec 12 '12 at 03:29
1

I had the same issue. I believe Jdi's answer is out-dated as it did NOT work for me.

My solution was to reinstall git

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

Git prompt me for a username & password which I entered. To check it worked I ran git push again and it did not ask for my credentials, all is good with the world again :).

jcgh582
  • 839
  • 2
  • 13
  • 20