While trying to clone an already existing repository from gitlab into my local drive. I used the format
$ git clone https://github.com/libgit2/libgit2 mylibgit
Gitlab actually requires a user when using deploy tokens. For me, this was caused by mixing in ssh syntax as http://:@gitlab.com:repo instead of gitlab.com/repo.
http://:@gitlab.com:repo
gitlab.com/repo