Github remote permission denied

后端 未结 5 1085
小蘑菇
小蘑菇 2020-11-28 03:23

I\'m trying to upload my repo on github and go through all the steps upto:

git push -u origin master

at that point it gives me the following er

5条回答
  •  迷失自我
    2020-11-28 04:16

    Unable to access https means: this has nothing to do with SSH (and switching to SSH, while possible, does not explain the original issue)

    This has to do with credential caching, meaning Git will be default provide the credentials (GitHub account and password) of the old account while you are trying to push to the new account.

    See if you have a credential helper that would have cached your (old account) credentials (username/password) used to authentication you.

    git config credential.helper 
    

    On Mac, as commented by Arpit J, just goto/open your keychain access->search for github.com related file->and edit credentials there.

    See "Updating credentials from the OSX Keychain"

    On Windows for example, that would be the Windows Credential Managers.
    Open the Windows Credential Store, and see if the first user is registered there: delete that entry, and you will be able to authenticate with the second user.

    (Here is an example for BitBucket)


    In command-line (see git credential):

    git credential reject
    protocol=https
    host=github.com
    
    

    and then to set the new username & password:

    git credential fill
    protocol=https
    host=github.com
    
    

提交回复
热议问题