This question has already been answered:

Half a year ago, I installed myself on a home PC with windows 7 git. I registered an account with a couple of repositories, but in general I almost did not use it. During the first setup I specified the username and email.

git config --global user.name1

git config --global user.email1

After a while, I registered a new account from another computer, and when git was first run, I already registered name2 and user.email2 in the console. Now the situation has arisen that user.name2 is on the working PC in Git, and a 403 error occurs on the home user.name1 because of this, when trying to upload the repository, the login and password does not ask for an error. Question: how to log out or remove your old user.name1 altogether and go to git under a new account?

I enter git remote -v I get fatal: Not a git repository (or any of the parent directories): .git

Reported as a duplicate member of PashaPash Apr 11 '18 at 18:52 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • Add to the question the result of git remote -v - Mikhail Vaysman
  • In that question there is no answer that would help me. I deleted the account from the - Management Panel \ User Accounts and Family Safety \ Credential Manager-- but with the new launch I still go to user.name1 - Sergey
  • one
    It is worth noting that the name of the system user in Windows, the name of the github user and the name used by git for the selected repository may differ from each other. git remote -v should be run in a directory with a git repository. - jfs
  • How can I change the user github name and the name used by git for the selected repository? - Sergey
  • one
    @ Sergey, git config --global - default settings for all repositories, git config --local - for a specific (execute in the working copy folder). Read more in the git config help - German Borisov

1 answer 1

Options in git config not related to access to a githab *. They are used only in commit data. Typically, only an email address is used to determine who commits. If the githaba account is not recognized at the email address, it simply shows the name.

When accessing the repository (push, pull, fetch, clone) via HTTPS, for all actions involving the server, you will be asked to enter your login and password on the githabe. Depending on the OS, the settings and the Git distribution, they can be stored in the credential storage ( for example, under Windows , its records can be found and deleted in the wilds of the control panel ).

When accessing the repository via SSH, the githab learns an account using an SSH key . You can find out what keys Git tries to use in Git Bash (which is present in all Git for Windows distributions known to me) with the following command:

 ssh -v git@github.com 2>&1 | grep "Trying private key" 

Ask the github about accessing SSH, dumping all the results into the standard output ( 2>&1 ), get the lines containing "Trying private key" from the results


* Usually. In the settings, a special SSH command with details (in your case hardly) can be specified or account credential storage settings (and this can be, but in this case, the storage is managed by the repository, not the config).

  • So what can I do to fill in a new commit or project on a githab? - Sergey
  • @ Sergey bang a saved githabb account (if it is saved somewhere) following the instructions in the reply. Either it will be an entry in the credential storage, or an SSH-key file (the response contains a command that will help you find it). And then set up access for a new one. - D-side
  • 45 sorry, but I created an ack on the githaba and downloaded the git myself - on one computer and I just need to upload (there were no problems with downloading) changes to the same branch, to the same account from another computer. Is it really that difficult, or do I really understand nothing? ( - Sergey
  • Excellent answer, did not know about testing ssh-access in this way. - Nick Volynkin