If Visual Studio Code is not installed on your system, instructions can be found at code.visualstudio.com.
ⓘ
You can run all of these commands in PowerShell if you prefer to use Git through PowerShell instead of VS Code.
Open VS Code and the Integrated Terminal
Use the shortcut Ctrl+` to open the integrated terminal.
Ensure Git is Installed
To check if Git is installed, run:
git --version If it is not installed, instructions can be found at git-scm.com.
Setup Environment Variables
By default, Git is usually installed in one of these locations:
C:\Program Files\Git\bin\git.exeC:\Program Files (x86)\Git\bin\git.exe
Add Git to the System Path
Windows 10 and Windows 11:
- Search for Environment Variables:
- Right-click the Start button and select System.
- Click About, then select System info at the bottom right.
- On the left sidebar, click Advanced system settings.
- In the System Properties window, click Environment Variables near the bottom.
- Edit System PATH:
- Under System variables, find and select the Path variable, then click Edit...
- If the path to Git is not listed, click New and enter the path to your Git bin directory:
C:\Program Files\Git\binC:\Program Files (x86)\Git\bin
- Restart your system (optional but recommended).
Verify the Changes
git --version Configure Git
Enter your name and email in the corresponding sections:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com" Review Your Git Config
git config --list Or look for only the name and email variables:
git config --get user.name && git config --get user.email