Skip to content

Commit 62786fe

Browse files
committed
ADD: instructions basicss to remove git submodule
1 parent de18b85 commit 62786fe

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,30 @@ You can merge few tags e.g.:
2424
git commit -m "WIP-CAP:<description> <--- for cap moment in not finished work
2525
```
2626

27+
### Delete submodule
28+
To delete a submodule in Win, you need to:
29+
1. Delete the relevant section from the `.gitmodules` file. The section would look something like this:
30+
```terminal
31+
[submodule "submodule_name"]
32+
path = submodule_path
33+
url = submodule_url
34+
```
35+
2. Stage the `.gitmodules` changes:
36+
```terminal
37+
git add .gitmodules
38+
```
39+
3. (optional) Delete the relevant section from `.git/config`. The section would look something like this:
40+
```terminal
41+
[submodule "submodule_name"]
42+
url = submodule_url
43+
```
44+
4. Run `git rm --cached path_to_submodule` (no trailing slash).
45+
5. Run `Remove-Item -Recurse -Force .git/modules/path_to_submodule`.
46+
6. Commit the changes:
47+
```terminal
48+
git commit -m "Remove a submodule name"
49+
```
50+
2751
#==============================================================
2852
# C++
2953

0 commit comments

Comments
 (0)