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?

1
  • Can you provide more detail about when it gets deleted (i.e., what command are you performing, etc)? Commented Jul 9, 2009 at 5:18

3 Answers 3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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

1 Comment

Most common used file name for this is empty .gitignore file (or .gitkeep file).
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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.