0

git noob here. I am trying to set up password caching for GitHub by following their documentation.

When I got to the step below I used 'which git' to see if my directory was the same as the example. My directory was /usr/bin/git . As the instructions said, I replaced the example path with my path.

(Example Path) $ sudo mv git-credential-osxkeychain /usr/local/git/bin

(My Path) $ sudo mv git-credential-osxkeychain /usr/bin/git

Unfortunately, there now seems to be a problem with Git. I can't run any Git commands. For example (git --help). If I try, it just returns a blank line. If I simply type Git into the terminal it returns

Usage: git credential-osxkeychain <get|store|erase>

I'm not sure where to go from here. Any help is greatly appreciated.

  • `which git` returns the path to the executable, not the path to the directory it's in. `/usr/bin/git` is the binary, and you overwrote it. – Edward Thomson Oct 05 '12 at 19:36
  • Do i need to replace the git exec file in usr/bin/git ? If so, do you know how I would go about it ? – user1695138 Oct 05 '12 at 22:04
  • Hey Ed. I deleted the git file from usr/bin/git and everything seems to be working fine again. My only concern is do I need that git exec file in usr/bin/git ? – user1695138 Oct 05 '12 at 22:20

1 Answers1

2

It looks like you've copied over your git binary with git-credential-osxkeychain. You probably wanted to do:

$ sudo mv git-credential-osxkeychain /usr/bin/

instead.

You'll need to re-install git, then copy the git-credential-osxkeychain binary to the right place.

When you say which git you get the name of the actual git program, not the folder.

Collin
  • 11,977
  • 2
  • 46
  • 60
  • 1
    Or, you can keep `git-credential-keychain` in `/usr/local/bin`, as long as `/usr/local/bin` is on your `$PATH`. – mipadi Oct 05 '12 at 19:52