tags:

views:

448

answers:

3

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?

+3  A: 

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
Most common used file name for this is empty `.gitignore` file (or `.gitkeep` file).
Jakub Narębski
A: 

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
+5  A: 

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
This was my problem. I had never before used git submodule, so didn't know to use it for this.
jamtoday