How do you setup a GitLab repo on Microsoft Visual Code?
There are two main scenarios –
- You have the code on your workstation and you want to push into a clean / new repository
- You want to pull code from an existing gitlab repository onto your workstation
First go to your local folder on your workstation (either empty or full of code)
git init git add . git remote add origin https://<username>:<usertoken>@gitlaburl.com/project/repo.git
The above commands tell git to run initial setup, add current folder as content then add associated remote gitlab repository.
Note the format to use while using a user token. The user token is issued by GitLab, your username will also be there. You will need to ensure that your token has both read and write access to the repository.