Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SmartGit, unable to push, "remote: HTTP Basic: Access denied"

remote: HTTP Basic: Access denied

remote: You must use a personal access token with 'read_repository' or 'write_repository' scope for Git over HTTP.

remote: You can generate one at https://gitlab.com/profile/personal_access_tokens

I've created Personal Access Tokens with all available scopes included and placed it in Edit -> Preferences -> Hosting Providers for the GitLab account, but I still can't push. The GitLab account has 2FA and I also have this installed if it matters.

Windows 10 x64.

like image 858
Necronomicron Avatar asked Jul 25 '26 11:07

Necronomicron


2 Answers

Since you have a credential helper installed, check if it is active:

cd C:\path\to\repo
git config credential.helper

If it returns "manager", open your Windows Credentials Manager and check if credentials are already stored for gitlab.com.
If so, delete it, then push again: Git should ask for your credentials. Do enter your PAT (Personal Access Token) as password.

like image 104
VonC Avatar answered Jul 28 '26 00:07

VonC


I was having similar issues trying to "git push" my changes from VS up to GitLab. After creating a personal access token I was able to successfully make a commit using the following steps:

  1. Create a personalized access token in GitLab
  2. In VS, I committed then entered "git push" in the terminal
  3. Enter the username at the top of VS (should be prompted after hitting enter on step 2)
  4. For password, copied and pasted the GitLab token I created earlier (from step 1)

Thank you @VonC !

like image 41
eguil35 Avatar answered Jul 28 '26 01:07

eguil35