6

I have a folder in my repository called 'activity'. It keeps getting strangely deleted from the repository, and isn't seen as an untracked file.

In github, it is rendered as a folder with a green arrow, and the text '→ f32111b' next to it. This has happened several times now, and only with this one folder.

I've already checked .gitignore. Is there another reason why a folder called 'activity' would be trouble in git?

JJ.
  • 4,974
  • 5
  • 39
  • 48

3 Answers3

12

That's not a directory, that's a submodule. Or at least GitHub seems to think so.

What does your .gitmodules file look like? Did you maybe forget to run git submodule init and git submodule update?

Submodules can be a little bit tricky, especially when you convert from a directory to a submodule or back.

Jörg W Mittag
  • 363,080
  • 75
  • 446
  • 653
  • This was my problem. I had never before used git submodule, so didn't know to use it for this. – JJ. Jul 10 '09 at 23:00
  • Can you link to some supplemental info here? I've seen some "permalinked" folders in other people's repos...mine won't hyperlink to the repo I cloned. For the lazy: [No submodule mapping found in .gitmodules for path 'your/path'](http://stackoverflow.com/questions/4185365/no-submodule-mapping-found-in-gitmodule-for-a-path-thats-not-a-submodule) – yurisich May 01 '12 at 02:44
5

Is the directory empty?

Git doesn't track empty dirs.

The hack trick is to touch an empty file in there if you really need to keep the directory kicking around.

madlep
  • 47,370
  • 7
  • 42
  • 53
1

In addition to the answer madlep gave (git doesn't tracks empty directories):

http://git.or.cz/gitwiki/GitFaq#CanIaddemptydirectories.3F:

That is, directories never have to be added to the repository, and are not tracked on their own.

Mark van Lent
  • 12,641
  • 4
  • 30
  • 52