26

When I run : git push, there is exist error like this :

remote: Access denied
fatal: unable to access 'https://gitlab.com/myname/mysystem.git/': The requested URL returned error: 403

Is there any people who can help me?

samuel toh
  • 6,836
  • 21
  • 71
  • 108
  • You don't have permission to push to that repository. `403` is the access forbidden error code. – J. Titus Dec 21 '16 at 13:23
  • 1
    Possible duplicate of [GitLab remote: HTTP Basic: Access denied and fatal Authentication](https://stackoverflow.com/questions/47860772/gitlab-remote-http-basic-access-denied-and-fatal-authentication). This was first, but it seemingly solves the same problem – serv-inc Jul 30 '18 at 16:11
  • Add a new ssh public key to yourself via "Edit Profile Settings" under gitlab, if you are keeping different public-private pairs for each machine. (also a note to self here) – kfmfe04 Aug 22 '18 at 05:05

10 Answers10

20

For Windows users, check this unbelievable easy solution, which works for me:

Go to Windows Credential Manager (press Windows Key and type 'credential') to edit the git entry under Windows Credentials. Replace old password with the new one.

mpro
  • 14,302
  • 5
  • 28
  • 43
14

For Windows User

Go to Control Panel->Credential Manager->Windows Credentials select github or gitlab credentials and modify it. This is for windows10

enter image description here

Update your credentials again

and add access token here

https://gitlab.com/profile/personal_access_tokens

Keshav Gera
  • 10,807
  • 1
  • 75
  • 53
8

You need to add an SSH key to your GitLab and make sure git is using that key.

You can find this documentation helpful.

afxentios
  • 2,502
  • 2
  • 21
  • 24
6

What might help is

git config --system --unset credential.helper

then enter new password for Git remote server.

Community
  • 1
  • 1
serv-inc
  • 35,772
  • 9
  • 166
  • 188
5

Basic Authentication / Access Denied issue fix:

  1. Open Terminal from respect tool (Ex: Source Tree)

  2. Execute this command --> git config --global credential.helper store

  3. Execute this command --> git pull

    i) provide your user name 2) provide your password

0

if you made your account by signing in with Github or Bitbucket, etc. add a password to your account so you can push, pull and clone with Gitlab.

Mahdi Abdi
  • 682
  • 6
  • 27
0

Very late here, but for posterity's sake:

If you do not have a gitlab password (initially signed up through github or something), then this will fail. You will just need to go to the page and create a password. At least that worked for me.

gust
  • 878
  • 9
  • 23
0

This happened to me today. First was a blue screen of death in Windows 10 (I'm using git for windows connecting to a Azure DevOps repo), so after a restart, I was able to run git status and git diff both were fine, and then git add . that was also fine. When I got to git push I got an error unable to access.

I had cloned the repo and used the supplied git credentials initially and didn't have to enter any more credentials. So, I tried git remote -v and it listed the remote repo. After this I tried git push again, and It worked. An easy one to try before you go more difficult routes.

Coffee and Code
  • 885
  • 14
  • 16
0

For anyone who is getting this error also on non-Windows platforms with GitLab 13+. There is another reason for this error apart from invalid credentials in your credential manager.

I had a problem where my account was using LDAP for authentication but still had a password expiration date set. Because the server was configured to use LDAP authentication only, the password expiration was not visible in the web UI and became only an issue after GitLab published a security fix with version 13.12.2.

You can check and edit the password_expires_at attribute of a user account via the GitLab Rails Console. Setting it to nil solved the issue for me and got the LDAP authentication working again.

Andy
  • 151
  • 9
0

check how to generate new password and try below

you can type in cmd

  • git pull

Username for 'https://gitlab.XXX.xx': XXXX Password for 'https://XXXX@gitlab.XXXX.xx': here u can enter new token or try this one also

  1. Go to "control panel"
  2. user accounts -manage credentials
  3. windows credentials
  4. git:https://username@gitlab.com
  5. click on down
  6. arrow Click remove. and add new token