Yes you can upload your git repo from vs code. You have to get in the projects working directory and type git init in the terminal. Then add the files to your repository like you do with regular git commits. Sign in to GitHub by using Visual Studio Code. Use Visual Studio Code to search GitHub for repos. Clone a repo from Visual Studio Code. Publish a local project to GitHub by using Visual Studio Code.
- Use Git Bash With Visual Studio Code
- Using Git With Visual Studio Code Tutorial
- Setting Up Github With Vs Code
Most of the time the Git integration of Visual Studio Code will do fine. But for other functions of Git the command-line seems more efficient. Once you use git over the command-line you’ll find yourself sometimes using a terminal text editor. Which might be fine for you. But if you’re the integrated terminal in Visual Studio Code it might feel a bit awkward. In this case you can set Visual Studio Code as the default editor for git.
During this example we will change the global git configuration. You can change the configuration on a repository level too. To do this; make sure you’re in the git repository and lose the --global
option.
Set Visual Studio code as git editor#
To set Visual Studio Code as default editor you have to run the following command.
Use Git Bash With Visual Studio Code
This adds the following configuration to your global git config.
By passing the --wait
to the code command you tell Visual Studio Code to wait for you to close the file before returning to the terminal.
Set Visual Studio code as git mergetool#
Besides an editor you can set a merge tool. Ofcourse you can use Visual Studio Code for this too. This is a two step process. First you have to define a new merge tool and secondly you need to set it as the default merge tool.
Using Git With Visual Studio Code Tutorial
This adds the following configuration to your global git config.
Setting Up Github With Vs Code
Set Visual Studio code as git difftool#
The same goes for setting the git difftool. You will have to run the following two commands.
This adds the following configuration to your global git config.
Summary#
You can change the git config to use Visual Studio Code instead of a terminal text editor. To do this in one step you can paste the following snippet in your git config file.
For more information read the Visual Studio Code docs.