Problem
In a Git project Big-Repo (contains a Git submodule Small-Repo), the Commit tool window of Big-Repo shows changes that belong to the Small-Repo.
How can these changes be hidden from the Commit tool window of the parent repositoryBig-Repo ?
Solution
Hide the gitlink entry
Set the ignore option on the submodule in .gitmodules:
[submodule "my-project-frontend"]
path = frontend-v3
url = https://example.com/my-project-frontend.git
ignore = dirty
ignore = dirty hides uncommitted changes inside the submodule from the parent repository's view of the gitlink. ignore = all also hides commit-pointer changes, so an intended submodule update is no longer offered for commit in the parent repository.
Hide the submodule's own files
Remove the VCS mapping for the submodule root:
- Open Settings (Ctrl+Alt+S on Windows/Linux, ⌘ , on macOS).
- Go to Version Control | Directory Mappings.
- Click the VCS column on the row for the submodule directory.
- Select None.
- Click OK.
The submodule no longer appears in the Commit tool window, and the IDE stops tracking imit inside the submodule from this project. Open the submodule as its own project instead. To restore tracking, set the VCS column back to Git.
Comments
0 comments
Please sign in to leave a comment.