Setting the username and password returns "github: command not found"

I have a fully working environment with SSH, but here at home I use more of GitHub for Windows instead of Git bash, so why is it configured with http .

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

Where can I find and install the github command, so I don’t need to enter my username and password every time? (I think I probably need to add something to PATH .)

+7
source share
4 answers

You can take a look at this very useful article: Configure git . You have a section where they explain to you how to save a password.

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


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

However, the best way to store a password is to not use it and rather use the SSH key. In the Github settings, it is possible to add a new one from Windows, just generate a key with PuttyGen or an alternative, export as an OpenSSH key and copy / paste it in the text area of ​​Gitub.
Then clone your repository using the SSH option:

 git clone git@github.com :your_username/your_project.git 

Or, if you already have an existing repository, change the URL ( here) :

 git remote set-url origin git@github.com :your_username/your_project.git 

You no longer need to enter a password, and it is very safe (if no one can access your computer and copy the private key).

+2
source

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

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

To verify the username, enter: git config user.name To configure your email (which is also important for GitHub), enter:

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

Pretend my email address is me@someaddress.com , so I typed: git config --global user.email " me@someaddress.com "

To check email settings: git config user.email

Sorry, I'm not sure how to save the password, but the username, I'm sure, works.

** Please note that you can apply these parameters globally or only to a specific directory / project. To apply them globally, leave them global, as I showed above, to apply them locally, just use the commands when in the directory to which you want to apply them, 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

+1
source

There is actually a github executable, and it is used to automatically log in in this case.

The current state seems to have installed Github for Windows (Github Desktop) and added its version of git to the PATH variable. (If the other reader does not, you can find out how to do it here .)

To find out where this mysterious github executable is located, run the git shell installed with Github for Windows and enter which github command.

On my system, this will spit out this path, on yours it will be different:

 /c/Users/Admin/AppData/Local/Apps/2.0/W25VPZXO.O5Y/DC9K5M2B.KL1/gith..tion_317444273a93ac29_0003.0003_5794af8169eeff14/github 

This is a Linux-style path that points to the github executable.

Change it to the Windows style path by changing the initial /c/ to C:\ (or whatever your letter on the disk is), changing the slashes to a backslash and knocking the back /github to get the directory.

For me, this again in your system will be different:

 C:\Users\Admin\AppData\Local\Apps\2.0\W25VPZXO.O5Y\DC9K5M2B.KL1\gith..tion_317444273a93ac29_0003.0003_5794af8169eeff14 

Add this to the (end) of your path and you can use git commands without having to fill in credentials. (You still need to install them once on Github for Windows, though.)

+1
source

If you clone GitHub repositories using HTTPS, you can use the Credential Assistant to tell Git to remember your GitHub username and password each time it talks to GitHub.

With Git for Windows, running the following commands on the command line will store your credentials:

 $ git config --global credential.helper wincred 

Read more

0
source

All Articles