14

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
  • 5,456
  • 17
  • 55
  • 97
  • 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

8 Answers8

15

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
  • 10,634
  • 4
  • 20
  • 35
7

What might help is

git config --system --unset credential.helper

then enter new password for Git remote server.

Community
  • 1
  • 1
serv-inc
  • 29,557
  • 9
  • 128
  • 146
6

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,334
  • 2
  • 20
  • 23
6

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
  • 8,200
  • 1
  • 56
  • 43
1

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
  • 592
  • 4
  • 26
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
  • 618
  • 5
  • 20
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.

Wing
  • 311
  • 3
  • 8