0

I am very new in Gitlab. For playing a little bit and start learning I have created a project and cloned in my local machine. I have done a change and I have committed it without problems. Now I am trying to push those changes from local to the remote repository in Gitlab.

I use Gitextensions for doing so and I am getting below error (see below screenshot):

enter image description here

I only have a branch in remote, the master and it is not protected. How can I give push permissions from Gitlab in order to I can do the push successfully?

Willy
  • 9,848
  • 22
  • 141
  • 284
  • 1
    [Related, but only a duplicate if you *intend* to use ssh instead](https://stackoverflow.com/q/70800884/1256452) – torek Jan 23 '22 at 06:12
  • How did you authenticate against the gitlab server from your command line ? Did you enable 2FA? Did you generate a token to access your repo(s) from your dev tools over https (see https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token) ? Which permissions did you give for that token ?..... – Zeitounator Jan 23 '22 at 11:26
  • @Zeitounator Honestly I have no idea. I am really lost with Gitlab. I am new in Git and Gitlab, sorry. No, I am not using 2FA, i have not enabled it in Gitlab under preferences. Token over https? mmmm that's sounds interesting, maybe what i am looking for. Please, could you explain me how could I configure gitextensions in order to use a token over https? I have not configured any token. Anyway I know that from Gitlab you can add a token under Gitlab account preferences. I don't know why Gitextensions is using by default https to access Gitlab.... – Willy Jan 23 '22 at 17:31
  • @Zeitounator ...Also I cannot see within Gitextensions any way to tell it to use https, ssh or any other method to access Gitlab. Also as I am seeing, you can access Gitlab in different ways: token over https, using ssh, or authorize applications to use Gitlab. It would be interesting some guide explaining the different ways to authenticate against Gitlab. – Willy Jan 23 '22 at 17:33
  • You coming from too far away. Your current problems and questions are for the most part git usage background (how to clone a repo, give the remote addresse, authenticate, etc.). The only part related to gitlab itself is weather you need a token in place of your password or not (but I suggest you use one anyway). All the docs you need are accessible online and referenced in any good search engine. Good luck. – Zeitounator Jan 23 '22 at 17:44

1 Answers1

2

As torek mentioned you should use ssh authentication with Gitlab server.

In Gitlab docs you can find helpful info
How to create an SSH key:
https://docs.gitlab.com/ee/ssh/#generate-an-ssh-key-pair

How to add this key to your Gitlab account:
https://docs.gitlab.com/ee/ssh/#add-an-ssh-key-to-your-gitlab-account

Tolis Gerodimos
  • 3,782
  • 2
  • 7
  • 14
  • I tend to prefer ssh auth as well for a bunch of reasons. But can you explain precisely why OP **should** use it ? What exactly is wrong with token authentication over https ? And how using ssh is going to fix the above problem exactly ? – Zeitounator Jan 23 '22 at 11:18