ERROR git is not recognized as an internal or external command

+2 votes

Every time I run the git command on windows, I get the following error:

'git' is not recognized as an internal or external command, operable program or batch file.

Is there any way to fix this? Thanks in advance.

Aug 2, 2018 in Git & GitHub by Tyrion anex
• 8,660 points
26,040 views

5 answers to this question.

+1 vote
Best answer

You have to set your PATH to point at your git installation.

Just follow the below steps:

  1. Navigate to "My Computer", right click
  2. Click on "Properties",
  3. Select "Advanced",
  4. Then choose "Environment Variables",
  5. highpoint the "Path" variable,
  6. click "Edit",

Then, add your path right before the "Variable value" field, separated by a semicolon from the already present entry.

answered Aug 2, 2018 by Sophie may
• 10,550 points

selected Dec 15, 2020 by MD
0 votes

Make sure you've set the correct path to your Git. You need to add the following paths to your PATH:

  • C:\Program Files\Git\bin\
  • C:\Program Files\Git\cmd\
answered May 7, 2019 by Himanshu
+1 vote

If you've opened cmd prompt before installation of git, close it and reopen it. This is because the environment variables are only read when an application in this case cmd is launched. Relaunching it would allow it to read the variables again and see the updated path.

answered May 7, 2019 by Sid
this helped me, thanks
0 votes

If you want to set up for a temporary purpose, just execute below command.

  1. open command prompt < run --> cmd >
  2. Run below command.
    set PATH=C:\Program Files\Git\bin;%PATH%
  3. Type git, it will work.
answered May 7, 2019 by Isheeta
+1 vote

You need to make sure git.exe is on the path, check with:

where git
answered May 7, 2019 by Yesha

Related Questions In Git & GitHub

0 votes
1 answer

error: The branch 'dev1' is not fully merged.If you are sure you want to delete it, run 'git branch -D dev1'.

Hi@akhtar, When you create one new branch in ...READ MORE

answered May 10, 2020 in Git & GitHub by MD
• 95,140 points
717 views
0 votes
1 answer

Why is Git commit not functioning with Git Bash?

This occurs because you might have git ...READ MORE

answered Aug 7, 2018 in Git & GitHub by Sophie may
• 10,550 points
298 views
0 votes
1 answer

fatal: Not a git repository (or any of the parent directories): .git

Hi@akhtar, I think you didn't initialize your folder ...READ MORE

answered Apr 29, 2020 in Git & GitHub by MD
• 95,140 points
4,935 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,035 views
+2 votes
1 answer
0 votes
1 answer

How to forcefully commit a file to Git even if the file is ruled as unchanged?

This is simple, just follow the below ...READ MORE

answered Jul 11, 2018 in Git & GitHub by Sophie may
• 10,550 points
1,766 views
0 votes
1 answer

How do I solve a Git checkout error: updating paths is incompatible with switching branches?

This error occurs when you are checking ...READ MORE

answered Jul 26, 2018 in Git & GitHub by Sophie may
• 10,550 points
3,556 views