git clone: Authentication failed for

前端 未结 12 1326
天命终不由人
天命终不由人 2020-12-25 09:57

Trying to access private corporate tfs. They gave me access by giving appropriate rights to windows user (domain\\login).

I\'m fine with accessing web interface of t

相关标签:
12条回答
  • 2020-12-25 10:21

    I had this same issue with my windows 10 machine, I tried many solutions but nor worked until I installed the latest git version. https://git-scm.com/downloads.

    0 讨论(0)
  • 2020-12-25 10:22

    In my case the error was some old username and password was stored in cache.

    So I removed it by going to sourceTree and delete the existing account.

    Now for the new clone then it will ask you for the password for the repo.

    0 讨论(0)
  • 2020-12-25 10:22
    1. Go to Control Panel\All Control Panel Items\Credential Manager and select Generic Credentials.
    2. Remove all the credential with your company domain name.
    3. Git clone repository from git bash terminal once again and it will ask for password and username. Insert it again and you are all set!
    0 讨论(0)
  • 2020-12-25 10:23

    As the other answers suggest, editing/removing credentials in the Manage Windows Credentials work and does the job. However, you need to do this each time when the password changes or credentials do not work for some work. Using ssh key has been extremely useful for me where I don't have to bother about these again once I'm done creating a ssh-key and adding them on the server repository (github/bitbucket/gitlab).

    Generating a new ssh-key

    1. Open Git Bash.

    2. Paste the text below, substituting in your repo's email address. $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

    3. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.

    4. Then you'll be asked to type a secure passphrase. You can type a passphrase, hit enter and type the passphrase again.

    Or, Hit enter twice for empty passphrase.

    1. Copy this on the clipboard:

      clip < ~/.ssh/id_rsa.pub

    And then add this key into your repo's profile. For e.g, on github->setting->SSH keys -> paste the key that you coppied ad hit add

    Ref: https://help.github.com/en/enterprise/2.15/user/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key

    You're done once and for all!

    0 讨论(0)
  • 2020-12-25 10:26

    I'm facing exactly same error when I'm trying to clone a repository on a brand new machine. I'm using Git bash as my Git client. When I ran Git's command to clone a repository it was not prompting me for user id and password which will be used for authentication. It was a fresh machine where not a single credential was cached by Windows credential manager.

    As a last resort, I manually added my credentials in credentials manager.

    Go to > Control Panel\User Accounts\Credential Manager > Windows Credentials

    Click Add a Windows credential link and then Supply the details as shown in the form below and you're done:

    I had put the details as below:

    Internet or network address: <gitRepoServerNameOrIPAddress>
    User Name: MyCompanysDomainName\MyUserName
    Password: MyPassword
    

    Next time you run any Git command targeting a repository set up on above address this manually created credential will be used.

    Is also important if you have a git command line you close it and reopen it for changes to be applied.

    Sharing my experience here in case it helps someone in future.

    0 讨论(0)
  • Go to > Control Panel\User Accounts\Credential Manager > Manage Windows Credentials and remove all generic credentials involving Git. This way you're resetting all the credentials; After this, when you clone, you'll be newly and securely asked your username and password instead of Authentication error.

    Hope it helps.

    0 讨论(0)
提交回复
热议问题