I'm trying to upload my React app to my GitHub repository, but Visual Studio Code won't recognize a Git command.
I have Git on the PC. The path to Git is correct, and I checked multiple times. I have installed GitHub Pages through the Visual Studio Code terminal. I have also added the required changes to file package.json. Now when I run git init
in the Visual Studio Code terminal, it throws an error that "git" is not a recognized command. Why is that happening and how can I fix it?
This is the Git path in Visual Studio Code - "git.path": "C:/Program Files/Git/bin/git.exe". It is correct.
Git Enabled is checked as well.
File package.json edits under the first {} "homepage": "http://greardrear.github.io/messenger", is added and under scripts added "predeploy": "npm run build", "deploy": "gh-pages -d build", .
And when I try to do "git init" or "git remote add origin", I get this message in the Visual Studio Code terminal:
git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ git
+ ~~~
+ CategoryInfo : ObjectNotFound: (git:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
How can I fix this?
PS. I have tried all of the "fixes" to this issue I could find. I have also tried changing the path to "git.path": "C:/Program Files/Git/git-bash.exe" which also didn't work.