Matlab git tools are lacking and can be confusing
조회 수: 7 (최근 30일)
이전 댓글 표시
Matlab has some built in git functionality that lets you do git commands without the use of the command line (similar to ToroiseGit). But the features are a bit limited and and times confusing, forcing me to resort to using the command line. I have two issues:
Commit a submodule
I'm using a submodule but not using Project. When I point the submodule to a new commit, the git status in the command line shows something like "submodule (new commits)". TortoiseGit also shows this. If you right click and go to Source Control -> View and Commit Changes it will let you pull up the commit dialog box but the change list is empty (assuming you have no other changes). If you click commit it will commit the update to the submodule index, which is what I want, but it's confusing that this change is not listed in the change list. Both the git command line "git status" and TortoiseGit show this type of thing as change to be committed.
Git Pull
Another issue is the git pull button. I have a configuration setting in git of git config submodule.recurse true. This means that when i do a git pull it will automatically pull any updates to the submodule. But for some reason this does not work when using the Matlab Pull button. It does work if you use git pull in git bash or !git pull in matlab (which pipes to git bash). So does the matlab Pull button not just do git pull using your local git install? I read somewhere that Matlab has some git functionality built in that does not use your local install of git. Is this why the Pull operation does not honor my configuration settings?
댓글 수: 1
Cris LaPierre
2025년 4월 18일
I would encourage you to submit your feedback directly to MathWorks. You can do that here: https://supportcases.mathworks.com/mwsupport/s/casetypeselection?language=en_US&c__caseParameter=productusage&s_tid=srlp_product
답변 (1개)
Ronit
2025년 7월 18일
When you update a submodule to point to a new commit, MATLAB's Git interface may not show this change in the change list. Always double-check with the command line using "git status" before committing in MATLAB if you’re working with submodules.
Regarding the "git pull" functionality, MATLAB's GUI may not fully respect your Git configuration settings for submodules. The MATLAB pull button might not execute the same command as "git pull" in the command line. Use the command line for pulls ("!git pull" in MATLAB command window works fine).
To perform a pull that respects your submodule settings, you can use the following command in MATLAB:
!git pull --recurse-submodules
These approaches should help you manage your Git submodules more effectively within MATLAB.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Source Control에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!