I have a Gitlab account for my job and I use my Github account for my personal purposes.
Can I connect the two accounts in Visual Studio Code and choose where to save the codes?
I have a Gitlab account for my job and I use my Github account for my personal purposes.
Can I connect the two accounts in Visual Studio Code and choose where to save the codes?
Once you have added a second remote to your Git repo (git remote add ...
), you can, from VSCode, use Push to in order to chose where you want to push a repository.
But if you issue is about pushing to GitLab for one repository, and GitHub for another, you don't have to do anything: each one will use (for HTTPS URL) their respective credentials. VSCode will simply push to origin
, as it does by default.
For SSH URL, you can use separate keys in your ~/.ssh/config
file, to differentiate the remote authentication.