Home > Net >  GitLab error to access git lab, but i can access github
GitLab error to access git lab, but i can access github

Time:03-07

im having this strange issue and i did't found any answers around.

I do pushes on gitHub ok, no problem.

In gitLab, i have this problem:

$ git push origin development [email protected]: Permission denied (publickey,keyboard-interactive). fatal: Could not read from remote repository.

Please make sure you have the correct access rights

And i do: $ ssh -T [email protected]
Welcome to GitLab, @barlera1989! (seems like this works fine)

Then: $ ssh -T [email protected]
[email protected]: Permission denied (publickey,keyboard-interactive). (seems like doesn't work)

I'm suspecting that i'm trying to push with a different email, as i see when i do git push.

Is possible to check / change that??

Note: My gitlab SSH key is fine!

I really have no idea whats going on! Any help will be appreciated!

Thanks!

CodePudding user response:

The commit email address and the git pull/push authentication are not the same thing.

You cannot use [email protected] for Git push. When pushing to GitLab over SSH, the SSH username is always git, not your username. GitLab identifies you based on the SSH key, not the username.

If you already have a Git remote set up for your repository, update it like this:

git remote set-url origin [email protected]:YOUR_GROUP/YOUR_PROJECT.git

Replace YOUR_GROUP/YOUR_PROJECT with your actual values.


Separately, unless you work for GitLab, you should not be using [email protected] or [email protected] as your commit email address either. Your commit email address should be a valid email address that belongs to you.

Note that using git config --global user.email EMAIL_ADDRESS does not retroactively change the address on any commits you have already done. Also, you might have set user.email without the --global flag, meaning that it is stored in the local .git/config too - if that is the case, the local value overrides the global value.

(Also, it looks like the GitLab username rafael belongs to somebody else. You should not use other people's names in your questions. If you don't want to share your real username, use example instead, so everyone knows it has been changed.)

  • Related