Setting username and password returns 'github: command not found'

bevacqua picture bevacqua · Oct 29, 2012 · Viewed 10.4k times · Source

I have the environment fully working at work, with SSH, but here at home I tend to use more GitHub for Windows instead of Git bash, so that's why it's set up with http.

github --credentials get: github: command not found
Username for 'https://github.com': user
Password for 'https://[email protected]': 
github --credentials store: github: command not found
Already up-to-date.

Where can I find and install the github command so I don't have to input my username and password every single time? (I think I probably need to add something to PATH somewhere.)

Answer

Julien Fouilhé picture Julien Fouilhé · Oct 29, 2012

You can take a look at this very helpful article : Set up git. You have a section where they explain to you how to save your password.

There is no Github executable, as Github is "just" a website, the message you see is git trying to get your credentials automatically (you can resolve this problem following the guide in the link above).


I want to talk about SSH anyway, because it can be useful to other people arriving here.

Still, the better way to store password is to do not use one and to rather use an SSH key. There's an option in your Github settings to add a new one, with Windows, just generate a key with PuttyGen or alternative, export as an OpenSSH key, and copy/paste it in the text area of Github.
Then clone your repository using the SSH option:

git clone [email protected]:your_username/your_project.git 

Or, if you have an already existant repository, change the url (saw here):

git remote set-url origin [email protected]:your_username/your_project.git

You will not need to type a password anymore, and it is very secure (as long as no one can access your computer and copy the private key).