0

Today my Git did some crazy things the whole day, which I could not quite put my finger on. But now I got a very strange problem:

When I initialize a new repository in a directory, add all files (add -A) and commit them, some still stay modified:

The Problem

Nothing helps, not even a hard reset to HEAD. The diff is as followed: Diff

I'm really at the end of my wit... The last thing I tried on this computer yesterday, was playing with some filters, when trying to solve another problem.

But all I did there was modifying a config and .gitattributes locally in a completely different directory. So any idea?

Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186
Nils-o-mat
  • 1,132
  • 17
  • 31

1 Answers1

2

Those are not files, those are git submodules within your master repository.

Regarding the messages,

  • untracked content means that there are some new files which are untracked in the submodule (if you didn't edit the submodule, consider these to be redundant files generated in code compilation, like *.so, *.pyc etc),

  • while modified content means that newer commits were made to the repo, which you can update using git submodule update.

Check Git: can I suppress listing of 'modified content'/dirty submodule entries in status, diff, etc? to suppress these messages.

EDIT

The OP points out that he didn't add the submodules. In that case, these seem to be the effect of gitlinks; I think by adding these sub repositories, git created gitlinks, which are the same underlying mechanism that submodules use. Check this for more help.

Community
  • 1
  • 1
Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186
  • I find that a little strange. I never used a submodule, but there are some other git-Repositories in this directory-tree. But there is no .gitmodules anywhere. Can you explain to me, what happens if you create a repository around a repository? – Nils-o-mat Feb 11 '15 at 15:37
  • @Nils-o-mat Ah! I think by adding these sub repositories, you created `gitlinks`, which are the same underlying mechanism that submodules use. Check http://stackoverflow.com/q/4161022/1860929 – Anshul Goyal Feb 11 '15 at 15:42