Push code error in git :Unable to locate the Git executable

21 vues (au cours des 30 derniers jours)
Sure
Sure le 16 Fév 2023
Réponse apportée : Divyam le 14 Oct 2024
When I try to use git to push code to the github repository in matlab, a window pops up asking me to enter my account and password. After I input, this figure appears.
However, I configured the ssh key. At the same time,when installing git, I installed the Git Credential Manager Core. I don't know how to solve this problem. Can someone help me?
  1 commentaire
Luca Ferro
Luca Ferro le 16 Fév 2023
doing the push from git bash get you this error as well?

Connectez-vous pour commenter.

Réponses (1)

Divyam
Divyam le 14 Oct 2024
Hi @Sure,
It seems that the issue stems from the Windows Environment not being able to locate the Git executable. To check whether "git" is recognized in your Windows environment, open the command prompt and type "git".
If "git" is not recognized as a command, then recheck the installation of Git on your machine. If Git is installed on your system, adding the path to "git.exe" executable and Git "cmd" folder to your Windows "Path" Environment variable will resolve this issue.
On my computer, the "git.exe" executable and "cmd" folders are on the "C:\Program Files\Git\bin\git.exe" "C:\Program Files\Git\cmd" paths respectively.
To add these to the Windows Environment "Path" variable:
  • Search and open the Environment Variables in settings
  • Then, under System Variables, look for the "Path" variable and click edit
  • Add the paths to "git.exe" executable and "cmd" folder to the end of the list
You can then restart your machine and check the Git version using the follwing command that should return the version of Git installed on your machine.
git --version
As an additional step, if you wish to enter your passphrase only once per MATLAB session, you can add the following commands in your MATLAB "startup.m" file
git = settings().matlab.sourcecontrol.git;
git.KeyHasPassphrase.PersonalValue = true;
For more information regarding the "startup" files, refer to this documentation: https://www.mathworks.com/help/matlab/ref/startup.html

Catégories

En savoir plus sur Source Control dans Help Center et File Exchange

Tags

Produits


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by