GitLab remote: HTTP Basic: Access denied and fatal Authentication

前端 未结 30 2191
攒了一身酷
攒了一身酷 2020-11-28 00:06

I am on mac OS unlike this post:

  • 'git push origin MyBranchName' throws error "HTTP Basic: Access denied"

I have password conf

相关标签:
30条回答
  • 2020-11-28 00:47

    I tried with browser URL for the repository then

    git clone $(browserURL)

    it prompted for my username and then my password

    It worked fine then

    0 讨论(0)
  • 2020-11-28 00:48

    None of the above solutions worked for me and I don't have admin rights on my laptop, but they eventually led me to the git tools credential storage doc :

    My setup Windows 10 | git version 2.18.0.windows.1 | Clone through HTTPS link

    This solution works if you use wincred as credential helper :

    > git config --global credential.helper
    wincred
    

    Changing the helper to "cache" should do the trick, as it will ask you to provide your credentials again. To set it to cache, just type :

    > git config --global credential.helper cache
    

    Check your update is active:

    > git config --global credential.helper
    cache
    

    You should now be able to clone / pull / fetch as before.

    0 讨论(0)
  • 2020-11-28 00:50

    If your trying to login Gitlab with your existing Git account. You need to reset your password of Gitlab, for the first time.

    1. Step: Navigate to setting by clicking your profile icon( drop down menu on top right corner).
    2. Step: Go to settings
    3. Step: Click on the lock icon or glyphicon icon(i.e password).
    4. Step : Enter the new password for Gitlab.
    0 讨论(0)
  • 2020-11-28 00:50

    Before digging into the solution lets first see why this happens.

    Before any transaction with git that your machine does git checks for your authentication which can be done using

    1. An SSH key token present in your machine and shared with git-repo(most preferred) OR
    2. Using your username/password (mostly used)

    Why did this happen

    In simple words, this happened because the credentials stored in your machine are not authentic i.e.there are chances that your password stored in the machine has changed from whats there in git therefore

    Solution

    Head towards, control panel and search for Credential Manager look for your use git url and change the creds.

    There you go this works with mostly every that windows keep track off

    0 讨论(0)
  • 2020-11-28 00:53
       git config --system --unset credential.helper
    

    then enter new password for Git remote server.

    0 讨论(0)
  • 2020-11-28 00:53

    For me it was some other git URL placed in config file, so I did change it manually:

    1. Move to .git/config file and edit it,
    2. Remove invalid URL(if it's there) and paste the valid git SSH/HTTP URL like below way:
    [remote "origin"]
            url = git@gitlab.com:prat3ik/my-project.git
    

    And it was working!!

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