One of my git submodules is always checking out a particular commit:
First, it appears modified in the main repository:
% git status
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: wp-content/themes/site-wp-theme (new commits)
This is the output of git submodule status
% git submodule status
+9eb1fbd567d588b44105487d368ff7d12b5fd50b wp-content/themes/site-wp-theme (heads/master)
15466ab74c20f67ef8ca04e7841d02e85323d36c wp-content/themes/wp-siteny-theme (heads/master)
Trying to update:
% git submodule update
warning: unable to rmdir admin/inc/cmb: Directory not empty
warning: unable to rmdir admin/inc/redux: Directory not empty
Submodule path 'wp-content/themes/site-wp-theme': checked out 'c010f3a0b6e5c4721d8e79d312b1fffa342340b8'
So then I have to go to the submodule, and do git checkout master
to restore it, which makes it show up again on git status
as modified.
This is my .gitmodules
file:
[submodule "site"]
path = wp-content/themes/site-wp-theme
url = https://ajf-@bitbucket.org/ajf-/site-wp-theme.git
fetchRecurseSubmodules = true
ignore = untracked
[submodule "siteny"]
path = wp-content/themes/wp-siteny-theme
url = https://ajf-@bitbucket.org/ajf-/wp-siteny-theme.git
fetchRecurseSubmodules = true
ignore = untracked
How can I solve this?