Reputation: 699
I want configure visual studio code to push change's project to GitLab.
I'm using Linux. Every time that I try do push, show this message to me:
Username for 'https://gitlab.com':
I generated ssh key and put in the GitLab user setting.
Git init, add. and commit works fine.
Upvotes: 1
Views: 3142
Reputation: 1323793
I generated ssh key and put in the gitlab user setting.
If Visual Studio is asking about https, that means the remote URL associated with your local Git repo is not an ssh one.
In command-line, go to your repo root folder, and type:
git remote origin set-url [email protected]:<yourAccount>/<yourRepo.git>
That will help Visual Studio Code pick the right URL (the one for which you registered your credentials through your public SSH key)
OR: you might want to keep your current https URL, but cache your GitLab username/password (since you don't want to have to enter them every time).
See "Use Git Credential Managers to Authenticate to Visual Studio Team Services" (it should apply to Visual Studio Code as well, and works on Windows or on Linux)
Upvotes: 1