views:

31

answers:

2

It might be a lack of coffee, but I've just had some, so I'll go ahead and ask anyway.

Here's a literal talk that I had with my terminal, with line breaks for readability.

$ ls -la
total 28
drwxr-xr-x   5 thomas thomas  4096 2010-10-02 09:32 .
drwxr-xr-x 153 thomas thomas 12288 2010-10-02 09:30 ..
drwxr-xr-x   5 thomas thomas  4096 2010-10-02 09:31 content
drwxr-xr-x   3 thomas thomas  4096 2010-10-02 09:31 template
drwxr-xr-x   7 thomas thomas  4096 2010-10-02 09:31 typely

$ git --version
git version 1.7.0.4

$ git init .
Initialized empty Git repository in /home/thomas/typely/.git/

$ git add -A

$ git st
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#   new file:   content
#   new file:   template
#   new file:   typely
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   content
#   modified:   typely
#

But these are all directories! Also, they have not been modified since I added them.

Thinking that something might be wrong with the directories, I tried cp -r to a new directory, but the same thing happens. If I git add the files directly, git doesn't complain, but they don't show up in git st either.

Am I losing my mind?

+2  A: 

Found it. These directories all contained separate git repositories!

$ find -name .git
./content/.git
./template/.git
./typely/.git

I'm leaving the question here in case anyone else ever runs into this problem.

Thomas
+2  A: 

They are being treated as submodules, which Git stores in the superrepository as a special kind of text files. Doing git diff when they are modified will show them as files containing the text Subproject commit plus a commit SHA1 ID.

Aristotle Pagaltzis