U. Windl
U. Windl

Reputation: 4411

git: directory seems to be both directory with modification and submodule

Some long time ago (in 2011) I had started a project with subdirectories. At some later time I decided to make those subdirectories submodules actually.

That was so long ago (in 2013) that I don't remember the individual steps.

Now I added two commits to a submodule (doing it in that subdirectory), also tagging a new version, then pushed.

After updating the submodule, adding and committing the changes, in the git main directory git status still shows "modified: directory (untracked content)".

I wonder how to get rid of that message (or at least I want to know what is causing that).

Upvotes: 0

Views: 50

Answers (1)

U. Windl
U. Windl

Reputation: 4411

(This answer is based on @torek's comments)

The status message you see means that the submodule has status.

That was the clue: I had diffed some changes into a file in the submodule directory, and that file wasn't ignored by .gitignore. So git status inside the submodule said "Untracked files:".

Once removing that diff output file in the submodule directory, then the status changed to "Your branch is up to date ...". After changing to the parent directory git status had changed to "Your branch is up to date ...", as well.

Upvotes: 1

Related Questions