GitLab remote: HTTP Basic: Access denied and fatal Authentication
Asked Answered
M

56

582

Unlike this post, I am on macOS.

I have the password configured in GitLab. I also have an SSL key created after the project was made on GitLab.

When I use an existing folder for a new project and follow the steps below, I am prompted to enter my GitLab username and password.

Existing folder

cd existing_folder
git init
git remote add origin https://gitlab.com/sobopla/Geronimod.git
git add .
git commit -m "Initial commit"
git push -u origin master

After the password is entered I get the following error.

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

Mannuela answered 18/12, 2017 at 0:26 Comment(5)
Following answers didn't work for me..If still anyone facing this issue in mac...this link might help... stackoverflow.com/questions/17659206/…Ruching
This error can also occur if your GitLab account has as password expiration date set but you are using another authentication method, e.g. LDAP. Then GitLab throws the 403 without even checking your credentials against the LDAP server.Hypogastrium
Penaltily related question: macos - How do I update the password for Git? - Stack OverflowDisembarrass
One workaround is to authenticate using SSH rather than HTTP. In the steps above, that would mean replacing the third line with git remote add origin [email protected]:sobopla/Geronimod.git. This should if you have your SSH keys set up properly.Risk
I'm surprised no one has suggested the first thing that you should do. Double-check your username and password!Elegit
P
971

It happens every time I'm forced to change the Windows password and none of the above answers helped me.

Try the below solution which works for me:

  1. Go to Windows Credential Manager. This is done in an EN-US Windows by pressing the Windows Key and typing 'credential'. In other localized Windows variants you need to use the localized term (See comments for some examples).

    alternatively you can use the shortcut control /name Microsoft.CredentialManager in the run dialog (WIN+R)

  2. Edit the git entry under Windows Credentials, replacing old password with the new one.

Parliamentarianism answered 30/8, 2018 at 8:49 Comment(18)
Thanks, that worked for me as well and solved the problem. You need this solution if you have different Github accounts on your deviceCrankle
It worked for me too though i am using multiple gilab accounts so what i did i updated my all the gitlab account with the same password that i have in my Credential Manger and the problem is solved Thanks@ParliamentarianismRogerrogerio
This seems a much cleaner solution under Windows and worked perfectly for me after updating my domain network password.Francklyn
Note: type it in your language system. Rus: "Credential Manager" = "Диспетчер Учетных Данных"Montana
@DanyWehbe If you have different Github account then I would suggest you to merge them into one, it will make it more easy for you to manage.Tristis
In my case editing credentials did not work for some reason. I had to remove credentials completely and add it again.Kohler
Great answer. This is especially a case with your work accounts where you have to change your passwords every now and then.Augustaugusta
In German it is "Anmeldeinformationsverwaltung" and then "Windows-Anmeldeinformationen".Decrepitude
Go to Windows credentials. You could see the git below. Change the password and try gitbash .Caslon
In French it is "Gestionnaire d’informations d’identification".Falda
How to create the git credential in the first place?Bigler
Perfect answer. Worked for me on GitLab.Hectoliter
It worked for me, as i was facing issue while pushing my commit to my gitlab personal account. Meanwhile i had saved other gitlab creds. from my office. Deleting all creds. solved my problem ofc by help of this ans. Thanks btw ;)Sverre
@Falda : I have "Gestionnaire d'identification". Maybe it depends on which Windows version one is on? I'm on Windows 10 Enterprise.Guibert
Swedish = AutentiseringshanterarenVolt
Worked like charm.. first I tried to clone Proj. with wrong credentials but in the meantime wrong credentials as were automatically stored in Win. Cred. Manager. I just had to edit them and update the new ones and clone them again.Data
Oh well! It works like charm! How could you explain that ? :)Ebeneser
Instead of editing credentials I added new (because no Git credentials existed there). Then entered git.company.name (enter your URL), a name and a password. When pushed a new branch to Git repository Windows asked a name and a password. In Russian this window is "Диспетчер учетных данных", "Учетные данные Windows".Revels
C
510

For me, the following worked:

Do not use your GitLab password, but create an access token and use it instead of your password:

  1. In GitLab, at the top-right corner, go to Personal Profile → Settings → Access Tokens Step 1

  2. Create a new personal access token (check the api option) Step 2

  3. git clone ...

  4. When you are asked for your password, copy and paste the access token instead of your GitLab password

    Step 3

Cameroncameroon answered 2/7, 2018 at 10:7 Comment(20)
Alternatively, on Windows, replace the password in Windows Credential Manager for the token.Weaks
I had already created a token but didn't know that after this you login with it instead of the password. Thanks for the tip.Brassbound
For me using password was not working (and I didn't have tokens yet), it only worked when I created a token and used it instead. Thanks!!!Physicalism
This should be the accepted answer. It is necessary in some projects according to the security configuration. Gitlab password will never work, just create and use your token. (Save your token in a secure place for future uses).Reciprocity
LOL, didnt found any place telling me that I should use access token in password field...Woodsy
A token name needs to set first.Hunter
This response deserves more upvotes, for the sheer user-friendliness. And I'm absolutely baffled, that the password is not my actual gitpassword but the token. I should have guessed it, but not going to lie, I hate how cumbersome gitlab feels.Algonquian
It worked! I was beating my head against the wall for hours with this. I don't remember seeing use the personal access token as the password anywhere -_-Opine
can you give an example of how to store the personal access token and then using it via git command in a bash shell?Divided
when I try git clone , it's not asking for a password. Directly cloning the project. I do have token .gitconfig but still receiving same errorTriangulation
After creating Access Token, go to Credential Manager and change the password for the git:https://gitlab.... and try git clone again. Worked for meSlight
To clarify for some use cases: you need to use this method if you have 2FA turned on for your account because you can't authenticate with 2FA via command line process (i.e. running git commands via the CLI).Oatcake
Doesn't work for me, got no idea why, I've been cracking my head at this for far too longRuthenium
Looks 'Settings' is 'Preferences' in GitLab dropdown now. Creating a token and updating it into Windows Credentials Manager 'Password' field worked. I have credential.helper=wincred (if you do git config --list you see what you have)Scientist
how do I set the contents of the access token? I need an access token that I can memorize because I am not comfortable storing the access token in any application on my computer.Risk
it happens if you authenticate your gitlab account with your gmail's email address. So the best option is to create a web token as it has been explained in with the screenshots. Save that web_token somewhere and always use that web token. Reason it does not accept your gmail password is because gmail will never gives your password to 3rd party. This is a security breach.Swindell
"when you are asked for your password"--> this only happens if there was previously no password or token. If one was defined git continues to use it. I now have a new token however and need to know how to get git to use it instead of the old one.Batsman
Does This access token work for all projects you have access to automatically or do they have to be manually added?Karyotin
This worked for me. Thank you soo much! additionally, I ran command at project level: git config --unset credential.helperKassa
Thanks, this also worked for me in Xcode, just used token as password in the username + password textfield and it workedAfar
Y
348

You can try the following command:

git config --system --unset credential.helper

Then, enter a new password for Git remote server.

Yettayetti answered 30/5, 2018 at 5:41 Comment(9)
Note that on Windows you need to run it as Administrator, otherwise you'll get permission errorsOviduct
It depends where you put your credentials. If the previous command does not work try also using global flag: git config --global--unset credential.helperPerseid
This is the most relevant answer for the OP as it addresses the issue, and doesn't go on some "on Windows" tangent. Also, as a side note, you may need to run this command as sudo if your user doesn't have access to /etcDemibastion
git config --system credential.helper manager, to use credential.helper again.Yettayetti
If you unset credential helper, you would have to provide username and password each time connecting to the GIT repository. To fix that you can set helper again by using the following command: git config --global credential.helper storeLedet
What if you don't have administrator access?Apomorphine
If you don't have administrator access omit --system or --global flag and set the credential helper only for your current git repositoryAffinitive
this also works on Mac OS.. You still need an admin access!!Inscribe
When re-setting the password with git config --global credential.helper store, the same note about needing sudo if you don't have /etc access also applies.Cranio
C
140

I got the same error and I solved this by :

  1. Apply command from cmd (run as administrator)

    git config --system --unset credential.helper

  2. And then I removed gitconfig file from C:\Program Files\Git\mingw64/etc/ location (Note: this path will be different in MAC like "/Users/username")

  3. After that use git command like git pull or git push, it asked me for username and password. applying valid username and password and git command working.

hope this will help you...

Cobaltite answered 26/6, 2018 at 11:56 Comment(5)
If you get that error, you can just run your command prompt as Administrator, and the error goes away.Oviduct
FYI: Just resetting the config (your first cmd) worked. I then did my git push and blammo! I think its because my shop requires monthly password changes so the internal git lab goes haywire.Fatherinlaw
also try it this way with --global git config --global --unset credential.helperFrancoise
deleting gitconfig file i get error: "error setting certificate verify locations: cafile"Cyclopentane
This works but it keeps asking me to enter my credentials for every pull command now. How do I set the credentials once and for all?Jacinda
R
93

The only thing that worked for me was using https://username:[email protected]/user/projectgit instead of https://gitlab.com/user/projectgit. See https://gitlab.com/gitlab-com/support-forum/issues/1654

Rhapsodist answered 27/6, 2018 at 0:30 Comment(3)
Thanks. Although for me have to replace it with SSL repo url but your answer make me help out. I have upvoted it.Petropavlovsk
Thanks. I didn't have such issue when using BitBucket or Github. With GitLab I have to create personal access token, then use that in remote origin git remote set-url origin https://usernameHere:[email protected]/usernameHere/projectNameHereAmes
This always work for meConchiolin
Z
52

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.

Windows Credential Manager

Zeb answered 30/11, 2018 at 20:7 Comment(3)
OP is on macOS, not Windows.Interposition
This wouldn't help OP, but it worked like a charm on my Windows dev box.Le
Though it is in Spanish, it helped me adding Git credentials in Windows. I entered control /name Microsoft.CredentialManager command, selected Windows credentials (not Internet credentals), than added Windows credentials (I wondered why haven't they already existed there). Added similar to git.company.name, name and password. When pushed a new branch to Git repository, Windows asked a name and new password.Revels
D
47

Just add your username before the domain:

https://**username**@gitlab.com/user/projectgit

And the assistant will ask you the password

Drive answered 17/7, 2019 at 13:27 Comment(2)
https://<username>:<password>@gitlab.com/user/project.gitBloch
@SalehRahimzadeh be aware that using the password in the URL will store the password in the .git/config file in plaintextDressy
E
37

I was also facing the same issue. The reason for the problem was authentication error. To solve this problem go to Control Panel -> Credential Manager -> Generic Credentials here find your gitlab credential and edit them. Make sure your ID password is right or not

enter image description here

Eda answered 3/6, 2019 at 9:43 Comment(1)
This did the trick, in my case it was because the company forces us to change the domain password every few months. This change didn't update the credentials in this credential manager. As soon as I updated the password it was working.Gilder
B
32

If you are using git > 2.11 and using Kerberos to interact with Gitlab you need set this configuration in your local git to avoid the remote: HTTP Basic: Access denied error.

$ git config --global http.emptyAuth true

Source

Brail answered 11/1, 2018 at 14:22 Comment(4)
I'm not using Kerberos but thank you for your reply.Mannuela
Kerberos aren't necessary. Thanks! git-scm.com/docs/git-configMekong
After doing a clean install of Git on Windows this morning. This answer solved Access denied error for me.Jenifer
Holy cow - I went through all the other suggestions and finally FINALLY this one worked. Indeed was using Kerberos!Pacific
C
27

Well, I faced the same issue whenever I change my login password.

Below is the command I need to run to fix this issue:-

git config --global credential.helper wincred

After running above command it asks me again my updated username and password.

Crampon answered 26/6, 2018 at 7:0 Comment(0)
C
20

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

Costumier answered 6/10, 2020 at 19:0 Comment(1)
Thanks @chuklore great to see people looking to understand the issue and not just quick fixes.Costumier
K
19

Note: do not mix GitLab SSL settings and GitLab SSH keys.

If what you have configured in your GitLab profile is an SSH public key, then your HTTPS URL would not use it.

Regarding your HTTPS credentials, double-check:

  • if the two-factor authentication is disabled, or
  • if you have special characters in your username or password, or
  • if you have a Git credential helper: git config credential.helper.
Kight answered 18/12, 2017 at 6:2 Comment(13)
- I have a space in my username because I authenticated Gitlab through Github - Two-factor autentication is disabled - What do you mean "If I have a Git credential helper?Mannuela
@Mannuela I mean: what do you see when you type git config credential.helper: that could have cached the wrong credentials.Kight
@Mannuela For the space, did you percent encode it? (en.wikipedia.org/wiki/Percent-encoding#Character_data: %20)Kight
I didn't do anything to the space in the name, the space comes from my name in GitHub, that GitLab grabbed during authentication login through Github.Mannuela
"authentication login through Github"... that does not looks like "my GitLab username and password". GitHub should not be involved here.Kight
It is involved because you can Login to Gitlab through Github... Like I said, my name has a space in it because of my name in Github. Gitlab allows a user to authenticate signing in through Github.Mannuela
@Mannuela I understand. Still, check what git config credential.helper returns.Kight
this is the output osxkeychainMannuela
@Mannuela Then delete any credentials (help.github.com/articles/…) in it related to github.com and gitlab.com, and try again.Kight
I was getting the error due to trying to use deploy keys while two factor authentication was enabled. Apparently you can only use personal access tokens if two-factor is enabled.Gama
I solved, just editing the password of GitLab in Windows Credentials, Thanks!Spot
I am facing the same issue for two days can not resolved this from sourcetree client. not understand why this is the most complicated user name and password changed ever madeBramante
@Bramante What is your SourceTree version, Git version, OS version? And what type of URL are you using for your remote repo? https://... or [email protected]?Kight
M
16

It happens if you change your login or password of git service account (GitHub or GitLab, Bitbacket, etc). You need to change it in Windows Credentials Manager too.

So, type "Credential Manager" (rus. "Диспетчер Учетных Данных") in Windows Search menu and go to your git service account and change data too.

enter image description here

Montana answered 26/5, 2019 at 18:19 Comment(1)
Although I didn't change my user or password (it is an AD credential), this happened to me because of a rebuild of the Gitlab server and the above solution has fixed this error.Esse
D
16

I beleive I'm little late here. But I think this would help the new peeps!

My Errors were: 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

fatal: Authentication failed for 'https://gitlab.com/PROFILE_NAME/REPO_NAME.git/'

I'm on Ubuntu but this worked for me:

  1. Goto https://gitlab.com/profile/personal_access_tokens
  2. Create new token and mark check to all.
  3. Copy your token
  4. Now go to your Terminal and paste it like this.

git clone https://oauth2:[email protected]/PROFILE_NAME/REPO_NAME.git/

Designed answered 16/5, 2020 at 8:10 Comment(3)
<USERNAME>:<PERSONAL_TOKEN>@gitlab.com/<USERNAME>/<REPO_NAME>.git works for me when configuring a "Mirroring Repository"Doriandoric
You sir, are my hero today!Readymix
For me with out profile name worked. git clone oauth2:[email protected]/REPO_NAME.gitCubital
P
14

Open command prompt as administrator then run this command:

git config --system --unset credential.helper
Proceeds answered 12/10, 2018 at 5:27 Comment(3)
could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Permission deniedRetarder
You do not use config file, just open you command prompt as administrator and run the command. Hope this helpsProceeds
try with sudo git config --system --unset credential.helperOringa
D
11

There are two ways I got around this problem:

  1. I added my username to the front of the remote URL (https://username@gitRepoURL)

    • Not always the best solution; where I work, even though we're slowly moving towards using GIT, we have our applications on a network drive, so if I do this, only I can push changes even if someone else worked on a feature.
  2. I can't run git config --system --unset credential.helper from GIT Bash, so I had to open up an Admin Command Prompt and run it there (this assumes you installed GIT such that it can run from both GIT Bash and the Command Prompt). From Bash, I get a "could not lock config file" error.

Derinna answered 11/3, 2019 at 18:52 Comment(1)
for more info, see: git config -l. Also try above with --global instead of --systemFrancoise
F
11

It is certainly a bug, ssh works with one of my machines but not the other. I solved it, follow these.

  1. Generate an access token with never expire date, and select all the options available.
  2. Remove the existing SSH keys.
  3. Clone the repo with the https instead of ssh.
  4. Use the username but use the generated access token instead of password.

enter image description here

alternatively you can set remote to http by using this command in the existing repo, and use this command git remote set-url origin https://gitlab.com/[username]/[repo-name].git

Fireguard answered 22/9, 2020 at 15:44 Comment(1)
Yeah, answers above did not work for me, and this was straightforward - "git remote set-url origin https://new-token-name:[email protected]/path/to/repo/"Armes
A
10

Try this:

  1. Go to: C:/Users/(YourUserName)/
  2. Delete file .gitconfig
Agree answered 25/6, 2018 at 3:29 Comment(1)
do not do this one, this kills your settings in generalDressel
B
10

Same problem with Sourcetree On Mac

Solution: Delete the password in keychain access.

enter image description here

https://community.atlassian.com/t5/Sourcetree-questions/SourceTree-quot-fatal-Authentication-failed-for-quot/qaq-p/201844

When you try to push again it will ask for your password.

Beeswax answered 31/7, 2019 at 7:34 Comment(1)
Did not work for me in Mac, It keeps failing with error HTTP Basic: Access denied. The provided password or token is incorrectPistoleer
C
8

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

Caramel answered 10/10, 2018 at 14:4 Comment(0)
S
8

When I had the same problem,

I solved it by removing the file "passwd" in

C:\Users\<USERNAME>\AppData\Local\Atlassian\SourceTree

After removing Sourcetree will prompt for the password.

Note:
OS Version : win10 
Sourcetree Version:  3.1
Scherzando answered 6/6, 2019 at 8:45 Comment(2)
This solved my issue on source tree.Incapacitate
This solved my issue with the Sourcetree.Bourse
S
8

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 = [email protected]:prat3ik/my-project.git

And it was working!!

Stilbestrol answered 5/10, 2019 at 10:15 Comment(0)
A
7

i removed gitlab credential from 'Credential Manager' in windows and pushed successfully

Antitoxin answered 26/8, 2018 at 6:22 Comment(0)
A
7

I had the same problem using GitLab, and here's how i fixed it:

  1. Generate an access token: to do so go to settings/access tokens, then give it a name and expiration date and submit.

  2. In your project files open the "config" file in ".git" directory: /.git/config.

  3. You will find a line like this:

    [remote "origin"] url = https://[username]:[token]@your-domain.com/your-project.git

  4. You will have your gitlab username instead of [username], and you should replace [token] with your token generated in step 1.

  5. Save the changes.

Arakawa answered 26/11, 2019 at 10:41 Comment(0)
S
6

For Mac user:

  1. Go to keychain and delete gitlab accounts
  2. Go to your project path in terminal and simply type git pull
  3. Then you will be asked for username and password for gitlab
  4. Enter your username which you will find out in gitlab account in profile section.
  5. Then after that enter you updated password here.
  6. Here we go, again try to push your code, it may help you guys.
Sidestroke answered 3/6, 2019 at 10:48 Comment(0)
O
6

Strangely enough, what worked for me was to sign out and sign back in to the GitLab web UI.

I have no earthly idea why this worked.

Oregano answered 27/7, 2020 at 18:26 Comment(0)
B
5

it worked for me: I use Mac and I wrote the path on finder:

~/Library/Application Support/SourceTree

I deleted the auth file which should be like

[email protected]

then tried to push and pull the code from the source tree and it worked.

You can also read the following answers:

https://community.atlassian.com/t5/Sourcetree-questions/How-to-update-HTTP-S-credentials-in-sourcetree/qaq-p/297564

Bitthia answered 5/11, 2018 at 10:7 Comment(0)
V
5

So for me the problem was that I had created my GitLab account via linking my GitHub account to it. This meant that no password formally existed for the account as it was created via hotlink between GitHub and GitLab. I fixed it by going to GitLab Settings -> Password -> and writing the same password as my GitHub account had.

Voidance answered 22/11, 2018 at 21:4 Comment(0)
L
5

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.

Laniferous answered 18/12, 2018 at 10:37 Comment(0)
H
5

This worked for me in Windows and Mac as well:

https://Username:[email protected]/path/to/repo/my-app.git

Here accessToken is your personal access token created in GitLab.

Hernandez answered 8/8, 2022 at 11:38 Comment(1)
For access token generation in Gitlab (sidebar menu): 1. Settings 2. Access Tokens 3. Set name for access token 4. Set expiration date and scope 5. Create project access token, then use git command: git clone YOUR_LOGIN:[email protected]/path/to/repo/my-app.gitEufemiaeugen
S
4

In my case I reinstalled to the latest version of git (currently 2.16.2). I don't know if it was that my old version of git was outdated, but I read on a github page that this should be done if you stumble into https cloning errors. I figured it was an https cloning error as the error focuses on HTTP Basic, while GitLab uses HTTPS. I might be wrong in this thought process, but the solution helped in my case, and I hope this helps anyone in the future!

Spinet answered 10/3, 2018 at 18:11 Comment(0)
D
4

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.
Dowd answered 11/6, 2018 at 10:31 Comment(0)
P
3

GO TO C:\Users\<<USER>> AND DELETE THE .gitconfig file then try a command that connects to upstream like git clone, git pull or git push. You will be prompted to re-enter your credentials. Kindly do so.

Pharyngeal answered 6/8, 2018 at 13:55 Comment(0)
D
3

I had to do below two steps to resolve this issue

  1. create ssh-keygen and add the public key to my gitlab account

  2. disable https using below command

    git config --global http.sslVerify false

enter image description here

Desirae answered 25/3, 2021 at 11:0 Comment(0)
H
3

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 and got the LDAP authentication working again.

Hypogastrium answered 10/6, 2021 at 12:49 Comment(0)
A
2

When the Windows Credential Manager asks for your credentials to access GitLab, those are username and password you use when accessing GitLab. EG: use your email and password.

Am‚lie answered 11/1, 2019 at 12:56 Comment(0)
D
2

Just for reference, I encountered this issues while using the URL wrongly after I generated and pasted the ssh_rsa.pub to the SSH Keys in gitlab.

$ git clone http://gitlab.x
Cloning into 'start-up'...
remote: HTTP Basic: Access denied
remote: You must use a personal access token with 'api' scope for Git over HTTP.
remote: You can generate one at http://gitlab.x

Solved by using the following URL instead.

$ git clone [email protected]/your_project.git
Dirge answered 2/7, 2019 at 6:41 Comment(0)
M
2

On mac use KeyChain -> Login -> Password: change password

Matrilateral answered 27/10, 2020 at 10:43 Comment(1)
What password in the keychain? I don't see anything containing with "git".Anthrax
L
1

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

Loats answered 15/5, 2018 at 11:59 Comment(0)
C
1

go to credential setting on your windows computer and Remove https://gitlab.com/sobopla/Geronimod.git

Carol answered 28/2, 2019 at 10:2 Comment(1)
OP said macOS .Le
V
1

I've faced this same issue after once I've entered the wrong credentials of my git account. The thing that did work for me is, open keychain Access -> Password -> find your entered wrong password and update it and hit save, after that you will be able to perform your operations on git without any issue.

I hope this works for you.

Volsci answered 6/4, 2020 at 7:32 Comment(0)
I
1

I had the same issue but before I went ahead to implement any of the suggestions on here, I checked if I was still logged into my github account. I had the problem while working in my Gitlab account. I found out I was still logged into my Github account and I logged out of the account immediately. I tried to clone again in Gitlab and I didn't have the error and the clone was successfully.

Interjoin answered 30/11, 2020 at 7:8 Comment(0)
H
1

You have to update the config file inside the .git directory with current access token. See This Link where I resolved the problem caused by accidentally changing the access token. I was using GITLAB and CLion,

Horner answered 17/9, 2021 at 14:19 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Boyish
H
1

I got the same error and I solved this by :

  1. Open Windows search
  2. Type: Git Bash
  3. Click second mouse button and select: Run as administrator
  4. Go to your project directory: cd "C:\path\to\our\project\name"
  5. Execute command: git config --system --unset credential.helper NB : On linux run this command with sudo command: sudo git config --system --unset credential.helper
Holden answered 18/1, 2022 at 17:34 Comment(0)
G
1

For me, i created a personal access token and then updated my git origin as thus:

https://<personal_access_token_name>:<personal_access_token>@gitlab.com/username/your-project.git
Gossipy answered 26/4, 2022 at 9:31 Comment(0)
H
1

Just add your repo link like this:

https://oauth2:<PAT>@gitlab.com/<Project>/<repo>.git

Hargis answered 14/6, 2023 at 11:56 Comment(0)
G
1

In case it will help someone - I had a similar issue and the root cause turned out to be using http instead of https.

When git clone ran in pipeline it was ok because it was calling from the same server, but it was throwing an error when cloning locally.

Gaelic answered 2/2 at 11:29 Comment(0)
B
0

I have same problem i followed these steps and it has been resolved. step 1:- set username amd password setp 2:- git push -f origin

Barbados answered 13/5, 2022 at 7:53 Comment(0)
B
0

In Gitlab go to the Administrator/Settings/General/SignIn Restrictions section.

If you are authenticating to your GitLab over HTTPS, make sure that you have:

Allow password authentication for Git over HTTP(S)

checked. This option assumes that you are not using 2FA. If you are not using an external authentication provider, you show also have the:

Allow password authentication for the web interface

also checked.

Bernadette answered 17/12, 2022 at 22:9 Comment(0)
M
0

Yes, this is a login credentials issue. In my case I was working on some ad-hoc temporary branch, I made changes, and committed it to the same branch. While pushing I was getting this error.

Next, I checked out in master. Took git pull, and it asked for my updated credentials. I entered correctly. After that, I checked out the ad-hoc temp branch, created a feature branch and pushed that branch to remote with no issues this time.

Multiplication answered 30/1, 2023 at 5:8 Comment(0)
C
0

I'd like to add one more variation to all of these already: if you are accessing a company instance of GitLab that is not behind a proxy, make sure you do not have the proxy variables set - e.g. HTTP_PROXY, HTTPS_PROXY. After going through pretty much all of the solutions in this question, I figured out my problem was due to this.

Cartagena answered 2/2, 2023 at 15:27 Comment(0)
W
0

Connect with the refused user first time into gitlab server and change the password, retry your git command and insert the new password. Cordially.

Whitsunday answered 12/10, 2023 at 14:34 Comment(0)
M
0

I have possibly the same issue since I have 2 ssh keys created, one for github and one for gitlab. Github key is in use by default, but to clone/push something to gitlab I have to do this in git bash:

  1. eval `ssh-agent -s`
  2. ssh-add ~/.ssh/GITLAB_KEY

Then it works fine. Note that I work in Windows, so for Mac it may look different

Macrography answered 11/12, 2023 at 3:14 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Boyish
C
0

Doing it on my Ubuntu I went to my .git directory there I opened my config file and hardcoded my user name and password

cd .git
nano config

and for the following

[remote "origin"]
        url = https://username:[email protected]/dinesh_simplyfi/llama-2.0.git
        fetch = +refs/heads/*:refs/remotes/origin/*

I changed username and password to my actual username and password

certainly not a secure way to go about it, but this is all that worked for me

Cortneycorty answered 13/12, 2023 at 7:31 Comment(0)
S
0

these commands work for me finely

cd existing_repo
git remote add origin http://x.git
git branch -M main
git push -uf origin main
Scriven answered 18/2 at 10:41 Comment(1)
Thanks for your contribution to StackOverflow, but unfortunately this does not answer the question: please explain how you got these commands working in a way that answers the question, otherwise you're just saying you didn't have OP's problem in the first place.Stubbs
S
-1

Create a new access token from gitlab ->setting --> access token

Stribling answered 18/6, 2019 at 5:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.