Make sure the folder contains git.exe is in PATH in Windows.
For Visual Studio Community Edition git.exe is in:
For msysgit versions 1.8.1 and above
For Visual Studio Community Edition git.exe is in:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd
Add project to local git
cd "folder path to your repo" git init git add . # add everything git commit -m "initial commit"
Use source control tab in VS Code
If you don't see GIT in source control tab you can update your git.exe location.- Go to settings in VSCode and search for "git path".
- Click "Edit in settings.json"
- Add path to user settings
"git.path": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\Git\\cmd\\git.exe"
Add to remote repository
C:\repo>git config credential.helper store C:\repo>git push https://gitlab.com/username/repo.git --all git: 'remote-https' is not a git command. See 'git --help'.git-remote-https command is not reachable
C:\repo>git-remote-https 'git-remote-https' is not recognized as an internal or external command, operable program or batch file.Add git-remote-https.exe folder path to PATH.
C:\repo>SET PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\binNow it is reachable.
C:\repo> git-remote-https error: remote-curl: usage: git remote-curl[ ]
C:\repo>git push https://gitlab.com/username/repo.git git: 'credential-cache' is not a git command. See 'git --help'. Username for 'https://gitlab.com': username Password for 'https://username@gitlab.com': git: 'credential-cache' is not a git command. See 'git --help'. Counting objects: 2653, done. Delta compression using up to 8 threads. Compressing objects: 100% (2324/2324), done. Writing objects: 100% (2653/2653), 23.62 MiB | 170.00 KiB/s, done. Total 2653 (delta 670), reused 0 (delta 0) remote: Resolving deltas: 100% (670/670), done. To https://gitlab.com/username/repo.git * [new branch] master -> masterError: 'credential-cache' is not a git command
For msysgit versions 1.8.1 and above
git config --global credential.helper wincredVersions older than 1.8.1
git config --global credential.helper winstoreGit config file:
[credential] helper = winstoreRelated errors:
Git http-push is not a git-command Adding "..\mingw32\bin" folder also solves it.