GIT - Error using GIT in merging branches
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi there, I would like to make use of GIT as a Source Control tool, via MATLAB integration, but I get an error when merging two branches. GIT, including GIT command line, is installed in C:\Program Files\GIT and I've filled in a valid (remote) repository and sandbox path using the Source Control manager. I am able to commit, push and fetch; but when I try to merge my current branch with a different branch, it gives an error stating:
"You need to install a command line GIT client before you can merge. See GIT installation instructions here."
Is it possible to enter the GIT installation path somewhere in Preferences/Options so that MATLAB knows where GIT command line is installed?
Thanks in advance for your help!
1 comentario
Bogdan Bodnarescu
el 13 de Jun. de 2022
Are you merging from Git Bash?
For me it works without any problems from the command line.
Respuestas (1)
Divyam
el 14 de Oct. de 2024
Editada: Divyam
el 14 de Oct. de 2024
In MATLAB, the source control integration is enabled by default and there are no settings to define the path for Git installation specifically.
Here, MATLAB is unable to find the Git command line to perform the merge. The root cause of this issue appears to be that the paths to your Git command line and "git.exe" executable are not added to your Environment variables. Adding these paths to your Enviroment variables will resolve the issue.
On my Windows 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
If the issue persists, you can try to perform the merge using command line arguments or reinstall and reconfigure Git by following the instructions given here:
0 comentarios
Ver también
Categorías
Más información sobre Source Control en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!