I'm working with three branches
master
develop
feature-new-theme
Where feature-new-themeis a fork of develop.
In feature-new-theme I've added a new git submodule, called bootswatch, in protected/vendor/bootswatch dir.
It's all ok until this day.
I do a 'freezing commit': commit all files and subdir on feature-new-theme with message 'freeze'. So I've nothing untracked and nothing changed to commit.
Then I create an hotfix branch forking master.
git checkout master
git checkout -b hotfix-1.35.3 master
When I do a git status I see protected/vendor/bootswatch as untracked. Why ?!
So I created a .gitignore file into protected/vendor with this content
bootswatch/
I committed .gitignore into hotfix, but still I see the untracked dir doing a git status.
git status
# On branch hotfix-1.35.5
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# protected/vendor/bootswatch/
Why? How to switch from a branch with a submodule to another without it in the right git way?
Edit to reply common questions:
feature-new-themehas never been merged intomaster, because new feature will be merged only intodevelop, and only at release stage we create arelease-x.y.zbranch, do bump version, do small fixes and then mergerelease-x.y.zbranch intomasterand intodevelop- the new submodule dir is untracked both on
masterand onhotfixbranches