1

I have been trying to use the Github commands on the cmd, but it keeps outputting

'git' is not recognized as an internal or external command

My PATH is already set and looks like

C:\Users\user\AppData\Local\GitHubDesktop\bin

I don't really know what to do; I already tried restarting and reinstalling. I saw one other question with a similar problem, but the response didn't quite make sense to me. Side note: I'm using a Windows 10 system

saeed
  • 2,477
  • 2
  • 23
  • 40
D. James
  • 23
  • 1
  • 1
  • 4
  • Possible duplicate of [What is the reason for '...' is not recognized as an internal or external command, operable program or batch file?](https://stackoverflow.com/questions/41454769/what-is-the-reason-for-is-not-recognized-as-an-internal-or-external-comman) – Mofi Sep 16 '17 at 13:47
  • Likely canonical (2010, 42 answers, and 600 votes): *[Error "'git' is not recognized as an internal or external command"](https://stackoverflow.com/questions/4492979/)*. – Peter Mortensen Dec 17 '22 at 02:13

2 Answers2

5

Assuming you have already installed git‍.

Now, if you want to setup for temporary purpose, just execute below command.

open command prompt < run --> cmd >

Run below command.

set PATH=C:\Program Files\Git\bin;%PATH%

Type git, it will work.

This is valid for current window/cell only, if you will close command prompt, everything will get Vanish. For permanently setting, set GIT in environment variable.

  1. Press Window + Pause
  2. Click on Advance System Setting.
  3. Click on Environment Variable under Advance tab.
  4. Edit Path Variable.
  5. Add the below line in the end of the statement:

    ;c:\Program Files\Git\bin;
    
  6. Press OK!
  7. Open new Command Prompt.
  8. Type git and press Enter.
Peyman Mohamadpour
  • 17,954
  • 24
  • 89
  • 100
1

You will need to download and install the Git Bash app, located here. This program will allow you to run all of the 'git' commands via its command line.

This link will provide more information, as it appears you have installed the GitHubDesktop program, not Git.

Hope this helps!

bmward
  • 46
  • 4