‘git' is not recognized as an internal or external command with salesforce cli

716    Asked by AnushaAcharya in Salesforce , Asked on Apr 24, 2021

I'm getting started with the Lightning Web Components and chose trailheads to get the insight into the basics. I am working on Push and Deploy Lightning Web Component Files of the LWC basics module. It requires installing e-bikes using the Saleforce DX. A step here involves cloning the app using the below command: git clone https://github.com/trailheadapps/ebikes-lwc However, this leads to the following error: 'git' is not recognized as an internal or external command, operable program or batch file. I have native git installed on my desktop and I'm not sure how to resolve this error even after.  How do you fix Git is not recognized as an internal or external command operable program or batch file?

 Any help would be much appreciated.

Answered by Anusha Acharya

GitHub Desktop is a distribution of Git that comes with a graphical user interface. It provides much of the same functionality as command-line Git, but if you wish to use this product to complete Trailhead modules, you'll need to translate the commands provided for use in the CLI into actions in the GitHub Desktop UI. GitHub provides instructions on how to clone a repository using GitHub Desktop. If you want to use the CLI version of Git, you'll need to make sure it is installed and configured appropriately for your OS. The main Git website is a good starting point that will provide download links for your OS. Note that while working with command-line Git, you'll have to take care of either authenticating with your username and password or setting up SSH, and you'll have to make sure (or your chosen installer will) that Git is in your PATH. GitHub Desktop abstracts those facets for you.

Follow this error to resolve this error:

Go to My Computer => Local Disk(C:) => Program Files(x86) => Git => cmd.
Right Click the git => Select Properties.
Under the location Copy the text eg - C:Program Files (x86)Gitcmd.

Come back to the Desktop.

Right-click My Computer.

Select property.

Open Advanced.

Click Environment Variables.



Your Answer

Interviews

Parent Categories