Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 399
bevacqua Avatar asked Oct 29 '12 14:10

bevacqua


People also ask

Why Git config is not working?

Try opening it and see do this file look like this. Try setting global config through command line by- git config --global user. email "[email protected]" It automatically set the . gitconfig in the directory it needed.


2 Answers

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

like image 117
Julien Fouilhé Avatar answered Oct 11 '22 18:10

Julien Fouilhé


To set your username: git config --global user.name "[Your USERNAME]"

My username is PyTis, so I typed: git config --global user.name "PyTis"

To test your username settings type: git config user.name To set your email (which is just as important for GitHub) type:

git config --global user.email "[You EMAIL]"

Pretend my email is [email protected], so I typed: git config --global user.email "[email protected]"

To test your email settings: git config user.email

I am sorry, I am not sure how to save the password, but the username, I am sure works.

** Pay attention here, you can apply these settings globally, or just to a specific directory/project. To apply them globally, leave in the global as I displayed above, to apply them locally, simply use the commands when in the directory you wish to apply them to, while omitting the "--global"

A few actual examples below:

(root@pluto)-(/home/jlee/NSIS-Walker)-(12:57 AM Tue May 12)-> (3 files, 60Kb)--> git config user.name "PyTis"

(root@pluto)-(/home/jlee/NSIS-Walker)-(12:57 AM Tue May 12)-> (3 files, 60Kb)--> git config user.name PyTis

(root@pluto)-(/home/jlee/)-(12:57 AM Tue May 12)-> (3 files, 60Kb)--> git config --global user.name "PyTis"

(root@pluto)-(/home/jlee/)-(12:57 AM Tue May 12)-> (3 files, 60Kb)--> git config --global user.name PyTis

like image 1
PyTis Avatar answered Oct 11 '22 19:10

PyTis