Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJose Morales-Mendizabal
19,175 PointsHaving trouble Setting up Git/Github Environment
Hey everyone,
So I'm new with Git and Github and I was following the instructions GitHub lays out to set up the environment. I already have Git installed. However I'm having trouble with the Password Caching Instructions. They ask to run the command
$ git credential-osxkeychain
# Test for the cred helper
# Usage: git credential-osxkeychain <get|store|erase>
When I run the command I do get the "Usage: Usage: git credential-osxkeychain <get|store|erase>" as output. So I assume I have the credential osxkeychain installed. So then they ask me to move the credentials helper into the folder where git is installed. So I ran
$ which git
#which outputs:
/usr/bin/git
That's the directory in which Git is installed right? But then I try to move the credential helper into that directory and It seems like I can't get it there
$ sudo mv git-credential-osxkeychain /usr/bin/git
# which outputs
mv: git-credential-osxkeychain: No such file or directory
Is there something wrong with my path? I'm really confused. Thanks!
2 Answers
bothxp
16,510 PointsI think I can see the confusion.
1st you checked if you had osxkeychain helper installed:
$ git credential-osxkeychain
usage: git credential-osxkeychain <get|store|erase>
That was a yes. So you should be able to move on to telling git to use osxkeychain by setting the global git config:
git config --global credential.helper osxkeychain
git-credential-osxkeychain is the credential helper that you can download from github. You don't need to go through the steps of downloading it and then moving it into the Git directory because you already have the osxkeychain credential helper installed.
Jose Morales-Mendizabal
19,175 PointsHey Matthew Brockway, You're right, I had osxkeychain installed all along. Turns out I was following a step in the docs that did no longer apply to me. Thanks for the clarification!
Jose Morales-Mendizabal
19,175 PointsJose Morales-Mendizabal
19,175 PointsThanks for the response! I ran the command that you suggested but the console did not print anything out. Is this supposed to happen?
bothxp
16,510 Pointsbothxp
16,510 PointsI was looking at the docs : https://help.github.com/articles/set-up-git
Getting nothing printed to the screen is probably a good thing as it didn't complain. If you are looking at that help page then you should note that the lines starting with the # are just comments added to explain what the commands are doing, you won't see them when you run the commands. For example when I run the below git credential-osxkeychain command I didn't get the "# Test for the cred helper" line.
So I think you should be all set. Just try it out now : "The next time you clone an HTTPS URL that requires a password you will be prompted for your username and password, and to grant access to the OSX keychain. After you've done this, the username and password are stored in your keychain and you won't be required to type them in to git again."