Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Version Control System » The term “git” was not used as the name of a cmdlet, function, script file, or executable Program recognized
  • PowerShell logo
    PowerShell: How to update PowerShellGet and Package Management Windows Server
  • lampstack feature lamp stack ubuntu
    How to Install LAMP Stack on Ubuntu 18.04 Linux
  • screenshot 2020 03 14 at 16.23.23
    Change Windows Desktop icon shortcut for fast user switching Windows
  • How to download install and use Kitty SSH Client on Windows
    How to Download and Use KiTTY SSH Client on Windows Configuration Management Tool
  • understanding azure active directory and enterprise mobility security ems 16 638
    Methods for Integrating Azure Active Directory with on-Premise Active Directory AWS/Azure/OpenShift
  • mendeley
    Install Mendeley Reference Manager: How to integrate Mendeley Cite for Microsoft Word on Mac JIRA|Confluence|Apps
  • TasteWP Homepage
    Launch a free WordPress test site with TasteWP JIRA|Confluence|Apps
  • win10
    How to add a device to Windows Windows

The term “git” was not used as the name of a cmdlet, function, script file, or executable Program recognized

Posted on 05/10/202109/06/2024 Christian By Christian No Comments on The term “git” was not used as the name of a cmdlet, function, script file, or executable Program recognized
term “git” was not used as the name of a cmdlet, function, script file, or executable Program recognised

In this article, we shall discuss how to fix the term “git” was not used as the name of a cmdlet, function, script file, or executable Program recognized. Git is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Please see Kindly refer to some of these related guides: How to install Git on macOS, how to clone a repository and install software from GitHub on Windows, Panic: Failed to register the GitLab-runner, you may be having network issues, and how to install and uninstall Docker Desktop on Windows 10 and Windows Server.

The most widely used modern version control system in the world today is Git. Git is a mature, actively maintained open source project originally developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel. Having a distributed architecture, Git is an example of a DVCS (hence Distributed Version Control System).

Rather than have only one single place for the full version history of the software as is common in once-popular version control systems like CVS or Subversion (also known as SVN), in Git, every developer’s working copy of the code is also a repository that can contain the full history of all changes. It is worth noting that, Git was designed with performance, security, and flexibility at heart.

The following error below was prompted because Git was not installed on Windows. Also, there is no environment variable or path defined where the docker executable programs are located.

section_end:xxxxxxxxx:prepare_script
section_start:xxxxxxxxx:get_sources
Getting source from Git repository
Fetching changes with git depth set to 50...
&: The term "git" was not used as the name of a cmdlet, function, script file, or executable 
Program recognized. Check the spelling of the name, or that the path is correct (if included), and
repeat the process.
In C:\windows\TEMP\build_scriptxxxxxxxxx\script.ps1:221 Zeichen:3
+ & "git" "config" "-f" "C:\GitLab-Runner\builds\xxxxxxxxx\0\documentati ...
+   ~~~~~
    + CategoryInfo          : ObjectNotFound: (git:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
section_end:xxxxxxxxx:get_sources
section_start:xxxxxxxxx:cleanup_file_variables

Install Git on Windows

However, To resolve this issue, we must install Git on Windows, as shown below. Browse to the official Git website and click on the 64-bit Git for Windows Setup as shown below.

Screenshot-2021-10-05-at-20.23.10

Moreover, Browse the downloaded setup file as shown below. Double-click the file to extract and launch the installer.

Screenshot-2021-10-05-at-20.24.03

In addition, Accept the User Access Control if you have it enabled in your environment. Nonetheless, Click on Yes to proceed. You may want to learn how to turn UAC on or off in Windows.

Screenshot-2021-10-05-at-20.24.31

Consequently, Please review the GNU General Public License, and when you’re ready to install, and then click on Next.

Screenshot-2021-10-05-at-20.24.52

Similarly, The installer will ask you for an installation path. Nevertheless, I will be leaving the default location unless you have reason to change it, and click Next.

Screenshot-2021-10-05-at-20.25.09

Therefore, In the component selection window, for me, I will leave everything as default. Additionally, Click on Next to proceed

Screenshot-2021-10-05-at-20.33.34

Furthermore, As you can see, the installer will offer to create a start menu folder. Just click on Next.

Screenshot-2021-10-05-at-20.33.51

However, Select a text editor you’d like to use with Git. Moreover, Use the drop-down menu to select an editor of your choice. I am okay with the default editor. Click on Next to continue.

Screenshot-2021-10-05-at-20.34.11

In addition, The next step allows you to choose a different name for your initial branch. Nonetheless, The default is ‘master.’ Unless you’re working in a team that requires a different name, leave the default option and click Next.

Screenshot-2021-10-05-at-20.35.04

Furthermore, Kindly refer to these related guides: How to create and deploy a local Registry Server with Docker Image, how to Pull your first Nginx Container Image from Docker Hub and deploy it to your local machine, Azure DevOps and GitHub integration for Docker and Kubernetes deployment, how to create a static pod in Kubernetes, and how to install, register and start GitLab Runner on Windows.

Customizing PATH Environment for Enhanced Command Line Control

Consequently, I will be selecting the second option. This allows you to change the PATH environment. Similarly, The PATH is the default set of directories included when you run a command from the command line. Leave this on the middle (recommended) selection and click Next.

Screenshot-2021-10-05-at-20.37.48

I will be selecting the Use bundled OpenSSH as shown below. I will click on Next to proceed.

Screenshot-2021-10-05-at-20.38.33

Nevertheless, The below window relates to server certificates. Most users should use the default. Therefore, If you’re working in an Active Directory environment and you have a Certificate Authority server set up, you may need to switch to Windows Store certificates. Click Next.

Screenshot-2021-10-05-at-20.38.58

Additionally, I will be selecting the very first option as it converts line endings. It is recommended that you leave the default selection.

Furthermore, This relates to the way data is formatted and changing this option may cause problems. Click on Next.

Screenshot-2021-10-05-at-20.39.40

However, I will be using the second option. Click on Next to continue.

Screenshot-2021-10-05-at-20.51.52

Moreover, The installer now asks what the git pull command should do as described in the image below. In addition, The default option is recommended unless you specifically need to change its behavior. Click Next to continue with the installation.

Screenshot-2021-10-05-at-20.52.52

Please decide on which credential helper to use. Nonetheless, Git uses credential helpers to fetch or save credentials. Consequently, Leave the default option as it is the most stable one, and click Next.

Screenshot-2021-10-05-at-20.53.28

Similarly, The default options are recommended. However, this step allows you to decide which extra option you would like to enable. Nevertheless, If you use symbolic links, which are like shortcuts for the command line, tick the box. Click Next.

Screenshot-2021-10-05-at-20.54.07

Therefore, Below are experimental options. I will leave them unchecked and then click on install.

Screenshot-2021-10-05-at-20.54.32

Additionally, As you can see below, Git is currently being installed and on the next window, the installation is completed.

Screenshot-2021-10-05-at-20.55.07
Screenshot-2021-10-05-at-20.55.56

Furthermore, Git has various modes of use. Below are some of the ways to launch Git in your enviornment. To launch Git Bash open the Windows Start menu, type git bash, and press Enter or click the application icon as shown in the image below.

Screenshot-2021-10-05-at-21.15.21
Screenshot-2021-10-05-at-21.15.39
Now, you should restart your GitLab runner now that Git has been installed on ypur device. Then try to launch the build job again. It should work correctly. But if it doesn't, then follow the steps discussed below.

Set the PATH to point at the Git installation

You will need to set (add) the following paths to the system variable as shown below. The steps I will be describing are exactly the same on Windows 10 and Windows 11.

C:\Program Files\Git\bin\
C:\Program Files\Git\cmd\

In the Start Menu, and click on Settings as shown below. Alternatively, you can use the taskbar search, search for “environment variable” or right-click on This PC and then click on Properties .

Screenshot-2021-10-05-at-22.10.16

This will open the Settings window as shown below. Click on System

Screenshot-2021-10-05-at-22.16.00

Navigate to the About menu and on the right-hand window, click on Advanced System Settings.

Screenshot-2021-10-05-at-22.16.51

Click on the Advanced Tab as shown below. Click the “Environment Variables” button at the bottom.

Screenshot-2021-10-05-at-22.17.19

Let’s create a System Variable. To do this, click on New as shown below.

Screenshot-2021-10-05-at-22.18.21

ATH editor, add C:\Program Files\Git\bin\ and C:\Program Files\Git\cmd\ to the end of the list.

Screenshot-2021-10-05-at-22.18.42
Screenshot-2021-10-05-at-22.19.53
Screenshot-2021-10-05-at-22.22.15

As you can see below, the system variable has been configured and set.

Screenshot-2021-10-05-at-22.22.36

Note: After creation, you can select the system variable and click on Edit to edit the path. Now, you can close the Environment Variable. Here is a similar guide discussing how to resolve “Running Docker commands returns Docker is not recognized as an internal or external command“.

Restart the GitLab Runner again

If you do not restart the GitLab-runner, the build job will still fail 🙂 To avoid this, please restart the GitLab-Runner as shown below. To do this via the Command line, please follow the steps discussed below.

Screenshot-2021-10-05-at-17.49.16

Ove via the services.msc. The same result will be achieved.

Screenshot-2021-10-05-at-17.48.02

Run the build Job again

As you can see below, I have run the build job again, everything is fine and the task passed (succeeded).

Job-succeeded

I hope you found this blog post on “The term “git” was not used as the name of a cmdlet, function, script file, or executable Program recognized” helpful. If you have any questions, please let me know in the comment session.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Version Control System Tags:Git, Git GUI, Git OSX, GitLab, GitLab-Runner, Microsoft Windows, Windows 10, Windows Server 2016

Post navigation

Previous Post: Running Docker commands returns Docker is not recognized as an internal or external command
Next Post: The connection was denied because the user is not authorized for remote Login: Enable Remote Desktop Connection on Windows 11 for non-administrators or selected users

Related Posts

  • ref error
    Error: cannot lock ref ‘refs/remotes/origin/windows’: unable to resolve reference ‘refs/remotes/origin/windows’, Not a directory Version Control System
  • Git not Recognized Image banner
    Fix Git is not recognised as an internal or external command Version Control System
  • git default branch min
    Git config –global init.defaultBranch: Error cannot lock ref ‘refs/remotes/origin/windows’, not a directory Version Control System
  • Azure CI CD Pipeline
    CI/CD Pipeline: Your First in Azure DevOps with ASP.Net Core AWS/Azure/OpenShift
  • coding
    Git GUI and Gitk won’t open “Missing Tcl / Tk Aqua libraries” Version Control System
  • Error during connect in the default daemon configuration on Windows
    Preparation failed: The docker client must be run with elevated privileges Version Control System

More Related Articles

ref error Error: cannot lock ref ‘refs/remotes/origin/windows’: unable to resolve reference ‘refs/remotes/origin/windows’, Not a directory Version Control System
Git not Recognized Image banner Fix Git is not recognised as an internal or external command Version Control System
git default branch min Git config –global init.defaultBranch: Error cannot lock ref ‘refs/remotes/origin/windows’, not a directory Version Control System
Azure CI CD Pipeline CI/CD Pipeline: Your First in Azure DevOps with ASP.Net Core AWS/Azure/OpenShift
coding Git GUI and Gitk won’t open “Missing Tcl / Tk Aqua libraries” Version Control System
Error during connect in the default daemon configuration on Windows Preparation failed: The docker client must be run with elevated privileges Version Control System

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • PowerShell logo
    PowerShell: How to update PowerShellGet and Package Management Windows Server
  • lampstack feature lamp stack ubuntu
    How to Install LAMP Stack on Ubuntu 18.04 Linux
  • screenshot 2020 03 14 at 16.23.23
    Change Windows Desktop icon shortcut for fast user switching Windows
  • How to download install and use Kitty SSH Client on Windows
    How to Download and Use KiTTY SSH Client on Windows Configuration Management Tool
  • understanding azure active directory and enterprise mobility security ems 16 638
    Methods for Integrating Azure Active Directory with on-Premise Active Directory AWS/Azure/OpenShift
  • mendeley
    Install Mendeley Reference Manager: How to integrate Mendeley Cite for Microsoft Word on Mac JIRA|Confluence|Apps
  • TasteWP Homepage
    Launch a free WordPress test site with TasteWP JIRA|Confluence|Apps
  • win10
    How to add a device to Windows Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,839 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.