Try to check from Terminal, if Git command is recognized.
Curently I'm using Powershell terminal.
git --version this should be return like this git version 2.28.0.windows.1
If that doesn't work then try these steps:
- Check VS Code Terminal Setting as explained on this link VS Code Documentation
- Update setting.json. My settings would be like this.
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"args": ["-NoExit", "-ExecutionPolicy", "Unrestricted", "-NoProfile", "-File", "C:\\Users\\LENOVO\\Documents\\WindowsPowerShell\\bootstrap-git.profile.ps1"],
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
}
}
- Close Terminal, and then Run Terminal again, and check if Git command is recognized with
git --version.
- Additional setting for Powershell to includes Git Command in
bootstrap-git.profile.ps1 file which is used in Point 2.
# Start a transcript
#
if (!(Test-Path "$Env:USERPROFILE\Documents\WindowsPowerShell\Transcripts"))
{
if (!(Test-Path "$Env:USERPROFILE\Documents\WindowsPowerShell"))
{
$rc = New-Item -Path "$Env:USERPROFILE\Documents\WindowsPowerShell" -ItemType directory
}
$rc = New-Item -Path "$Env:USERPROFILE\Documents\WindowsPowerShell\Transcripts" -ItemType directory
}
$curdate = $(get-date -Format "yyyyMMddhhmmss")
Start-Transcript -Path "$Env:USERPROFILE\Documents\WindowsPowerShell\Transcripts\PowerShell_transcript.$curdate.txt"
# Alias Git
#
New-Alias -Name git -Value "$Env:ProgramFiles\Git\bin\git.exe"
Alternatively, if you're already installed Git, then try to using Git Bash Terminal in VS Code.