If you don't have a Git provider yet, we recommend you start with GitHub since the Git experience in Visual Studio is optimized for this provider. Otherwise, easily create a new Git repository and add your code. If you have a Git repo hosted on a Git provider like GitHub, clone the repository to your local machine.
To get started using Git with Visual Studio: Or, you can work locally with no provider at all. You can work remotely with the Git provider of your choice, such as GitHub or Azure DevOps. Version control with Visual Studio is easy with Git.