Updating Git Submodule Reference on Parent Repository

조회 수: 43 (최근 30일)
Eduardo
Eduardo 2025년 1월 21일
답변: Sivsankar 2025년 2월 11일
I would like to use MATLAB's git GUI to do the following:
(I am not using Projects)
After committing all changes to a submodule. How can I update its reference on the parent repository?
Thanks in advance.
  댓글 수: 1
Prathamesh
Prathamesh 2025년 1월 31일
Hi @Eduardo can you please attach the screenshot of your parent repository and submodule in MATLAB (current folder) and screenshot of your remote(github) repo?

댓글을 달려면 로그인하십시오.

답변 (1개)

Sivsankar
Sivsankar 2025년 2월 11일
If you've set up a project using the GitHub repository "ParentProject," the submodules (e.g., "SubModule") are recognized as GitHub submodules. You can also add Git submodules through MATLAB by following the instructions at this link:
Once your source control is set up, to have each submodule be a referenced project, you need to make the "SubModule" folder a project as well. After setting up .prj files in both the parent and submodule folders, you can link the submodule project as a referenced project for the parent project.
The file structure should look like this:
ParentProject/
.git
.gitignore
.gitmodules
ParentProject.prj
SubModule/
README.md
File1.m
SubModule.prj
To link the submodule repository as a referenced project under the ParentProject,:
  1. On the Project tab, in the Environment section, click References. The Add Reference dialog box opens.
  2. Browse to select the required project (.prj) file.
  3. In the Reference type field, select Relative since your project hierarchy has a well-defined root relative to your subproject root (e.g. your subproject is in a source controlled parent project folder)
  4. To create a checkpoint when you add the project, select Set a checkpoint to detect future changes. For more information about checkpoints, see Manage Changes in Referenced Project Using Checkpoints.
  5. Click Add.
For more information on how to add referenced projects, please see:
Thanks

카테고리

Help CenterFile Exchange에서 Octave에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by