'Git on OSX hangs on each command: How to fix it?

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?

git


Solution 1:[1]

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

Solution 2:[2]

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 :).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Glorfindel
Solution 2 jcgh582