Github Desktop doesn't set up 'git' on cmd [windows] - windows

I installed GitHub Desktop, but it doesn't seem to have successfully set up the git command on the command line. When I try to call git, cmd gives me the error,
'git' is not recognized as an internal or external command, operable program or batch file.
The following path was added to my environment variables; is there some way I should edit this to make git work in cmd?
C:\Users\Me\AppData\Local\GitHubDesktop\bin

Find the git.exe file using WHERE git. This is the directory that should be added to your PATH environment variable.
WHERE git
Mine is in C:\Program Files\Git\cmd\git.exe.
I have C:\Program Files\Git\cmd added to the PATH environment variable.

Related

Flutter: unable to find git in path

When ever I run any command related to flutter in VS Code it returns the following:
'where' is not recognized as an internal or external command,
operable program or batch file.
Error: Unable to find git in your PATH.
exit code 1
I am on a Windows 10 Home system with Git in the system PATH variable.
Try to run the command from the command line (in the app folder).

How to understand PATH vs $PATH$ on different command line interfaces

I ran the command heroku version on my Windows CLI, and it returned the version of Heroku I have.
But when I do the same on my Windows Gitbash CLI, it says:
Doesha#Bub-PC MINGW32 ~
$ heroku version
/c/Program Files/Heroku/bin/heroku: line 4: /c/Program Files/Heroku/ruby-1.9.3/bin/ruby: No such file or directory
When I look at my path variables using the PATH command on my Windows CLI, my path looks like this:
C:\Users\Doesha>PATH
PATH=C:\Program Files\ImageMagick-6.9.2-Q16;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;
When I look at my path variables using the $PATH$ command on my Windows Gitbash CLI, my path looks like this:
Doesha#Bub-PC MINGW32 ~
$ $PATH$
bash: /c/Users/Doesha/bin:/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/mingw32/bin:/usr/bin:/c/Users/Doesha/bin:/c/Program Files/ImageMagick-6.9.2-Q16:/c/ProgramData/Oracle/Java/javapath:/c/WINDOWS/system32:
Can someone tell me why my paths for both CLI's look different? (For example C:\Program Files\ImageMagick-6.9.2-Q16; and /c/Program Files/ImageMagick-6.9.2-Q16: look different).
Does each CLI have it's own set of path variables?
If so, how can I set up Heroku so that it can be added to my Windows Gitbash CLI path variables also?
The PATH will be different in an msys2 Git bash session since / represent where git is installed (with /etc/, /usr/, ... being the subfolder you see in your Git installation folder).
(see also "How are msys, msys2, and msysgit related to each other?")
Check that the /c/Program Files/Heroku/ruby-1.9.3/bin/ruby knowing that it is case sensitive in the bash session (it is not in a CMD Windows session).

Issues installing PhantomJS for windows: command not recognized

following the docs here: http://attester.ariatemplates.com/usage/phantom.html, I am trying to install phantomjs on my windows machine.
I tried adding multiple lines to my Path system variable, and yet, I get the same error in the command prompt when I type in phantomjs --version.
" 'phantomjs' is not recognized as an internal or external command, operable program or batch file."
I added the phantomjs.exe to C:\phantomjs\bin\, and added C:\phantomjs\bin\phantomjs to the path, and any variation that I could think of, such as:
C:\phantomjs\bin\phantomjs.exe\; C:\phantomjs\bin; C:\phantomjs\bin\phantomjs\;
How am I not installing this right?
You don't need to put all the directories to the environment PATH variable.
Add only following to your path and restart your command prompt.
C:\phantomjs\bin\
Add phantomjs.exe to C:\Windows\System32 folder.

Adding Git to PATH Variable - Can't find GitHub under AppData/Local

I was following this guide here on how to add Git to my Path variable so I can use it from the command line (Not just Git Bash).
Installing Git in PATH with GitHub client for Windows
To quote an answer, Git was supposedly located here
Get the Git URL
We need to get the url of the Git \cmd directory your computer. Git is
located here:
C:\Users\\AppData\Local\GitHub\PortableGit_\bin\git.exe
I opened File Explorer and went to the directory C:\Users\AppData\Local\
Under the view tab, I have Hidden Items checked. I cannot see a GitHub folder listed. In the search bar, I appended GitHub to the end of the directory path and got the following message
Windows can't find 'C:\Users\username\AppData\Local\GitHub'. Check the spelling and try again.
I'm trying to add Git to my environment path variable, but can't find where git is located.
In Git Bash, I was able to try which git where I got /bin/git
But I'm not sure how I can find what to put in under environment variable.
Doing a random search, I actually found that the Git folder was located here
C:\ProgramFiles(x86)\Git
But what am I supposed to enter for the path variable? This is different from the answer in the other question.
Just add the path to the command. This was the path to add to the end of the windows PATH.
C:\Program Files\Git\bin\
Now we should be able to find git.exe by typing
git
It turns out Git was being sneaky!
It was supposed to be installed in AppData/Local, but was actually installed in the Program Files(x86) directory.
I added this to my Path variable after a semicolon
C:\Windows\Program Files(x86)\Git\bin\git.exe
And magically, I can run git again.
For Windows 7 using GIT 2.7.2 I used this in the path under environment variables:
;C:\Program Files\Git\bin;C:\Program Files\Git\bin\cmd. I then typed git --version from a command prompt and got:
git version 2.7.2.windows.1
Another way is found in this place https://stackoverflow.com/a/34767523/5842689
the best thing is you can test if work in cmd.
"o verify, restart cmd and type git --version in cmd"
it works for me cause the real path in my case (Win10 x64)is
C:\Program Files (x86)\Git\bin\git.exe

Unable to run git from command line

I have installed GIT for Windows right now. And when I am running this into my symfony project to reinstall the vendors by
php bin/vendors install --reinstall
Then i am getting an error
git' is not recognized as internal or external command
I have set the environmental variables also as
c:/programme files/git/cmd
Now what should I do?
I have tried also for environmental variables
c:/program files/git/bin
but I am getting the same error
Two possible solutions:
My PATH has backslashes instead of forward ones.
your first line contains a typo, should be c:\program files\git\cmd
One more: If your path includes spaces, enclose it in quotes:
set PATH=%PATH%;"C:\Program Files\Git\cmd"
During Git installation, in the path environment settings chose the following one.
Even I had the same problem, of git not executed on my normal Command Line, but i just reinstalled it with the setting "Run Git from the Windows Command Prompt"
Just open cmd and run this command:
set PATH=%PATH%;"C:\Program Files\Git\cmd"

Resources