Visual Studio Code uses Git authentication provided by the operating system (such as macOS KeyChain or Windows Credential manager) with any git functionality. Output is visible in Command Palette > Git: Show Git Output.
Open your local repository
If you have an existing repository on your local computer and want to open it in Visual Studio Code, just open the folder. Visual Studio Code recognizes the .git subfolder and display the relevant information.
Select source control from the activity bar, or use the key combination of Ctrl + Shift + G.
Select Initialize repository.
This action isn't available from this feature. Select a different tab.
Open the command palette with the key combination of Ctrl + Shift + P.
Filter with Git, then select Initialize repository.
Select the folder to select as the root of the repository.
Open an integrated terminal from Terminal -> New Terminal.
Initialize your folder with git with the following git command:
git init
Once the repo is initialized, create the repository on GitHub. Then add that repository as a remote to your local project from the Command palette: search for Git: Add remote.
Create a branch for changes
Create a new branch to capture changes and isolate from the main or default branch.
You can quickly and easily open a GitHub repository either by searching for GitHub Repositories: Open Repository... from the Command Palette, F1, or by choosing Open GitHub Repository... from the remote indicator (the green button in the lower left corner of the status bar).