2

I am using git-lab. I am facing an error while using git pull/push/clone command:

remote: HTTP Basic: Access denied fatal: Authentication failed for 'https://gitlab.com/myname/myproject'

I am facing this problem after git config --global --unset credential.helper.

Can anyone help me to come out of this problem?

Do I need to do any proxy settings? (is this firewall related issue?)

I am struct and I am not able to get working solution for this.

3 Answers 3

5

I tried many solutions listed in other similar questions , including the one mentioned above but it did not work me. what did work for me is the below way.

  • Go to your project directory and find for .git folder which will hidden by default.
  • Enter that and find for a config file and open with text editor and make changes to its token in the URL key something like below

[remote "origin"]

url = https://gitlab-ci-token:<token>@<repository-URL> 

In my case the token had expired which one can easily generate in the settings -> Access token->Create a token.

Copy paste this token to your config file in .git folder and Restart your IDE for changes to reflect.

Hope this helps!!!

Sign up to request clarification or add additional context in comments.

Comments

4

Finally works after resetting the username & password in windows credential manager. thanks

Comments

4

First of all open CMD as administrator (CTRL+SHIFT+ENTER) then insert this

git config --system --unset credential.helper

Then you will type you username and password. Thats all.

3 Comments

Thx, that's the one that helped me, however, it worked with --global instead of --system.
yes I confirm with git config --system --unset credential.helper I obtain error: could not lock config file /etc/gitconfig: Permission denied with git config --global --unset credential.helper it's ok
@936940 that is because you are not running it as an admin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.