What I suspect happened is git add . worked just fine. Here's how that would normally go.
$ git init bar
Initialized empty Git repository in /Users/schwern/tmp/bar/.git/
$ cd bar
$ touch foo bar baz
$ git add .
Note that git add . didn't say anything, it just worked. We can check with git status.
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: bar
new file: baz
new file: foo
Anything in Changes to be committed is in the "staging area" (aka the "index" or "cache"). This is where you build your next commit and is fairly unique to Git.
Whereas other version control systems will commit any changes to any tracked file, Git will only commit what you've copied to the staging area with git add. When you git commit it's the content of the staging area that will be committed.
git add does two things: it tells the version control system to "track" the file, and then it copies the whole file to the staging area. The tracking sticks, but the copy only happens once.
Or my other hypothesis is that my slight change, changes the hash of the file so git recognizes it as a new file to be added?
Almost. Git must be told to track files. Once tracked, it will notice changes via the file's hash/checksum, but it will not automatically add those changes.
Here's an illustration.
$ echo 'Basset hounds got long ears' >> foo
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: bar
new file: baz
new file: foo
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: foo
Note that foo is both in the staging area and it's modified "not staged for commit". That's because git add copied foo to the staging area, and it does not automatically copy the new changes. If you git commit now you won't get those changes, they have to be added to the staging area.
$ git add foo
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: bar
new file: baz
new file: foo
This might seem tedious, and it is. Once you've tracked the files you can commit all changes with git commit -a. This commits all changes to all tracked files.
The staging area can be annoying at first, but once you've learned to use it it can become a powerful tool to slice large commits up into smaller ones.
Let's say you've been working and you find that you've done a lot of changes. Too many for a single commit. Maybe you've added fixed some doc typos, fixed a few small bugs, renamed a method, and added a feature. You can use the staging area to pull this apart into multiple commits.
git add -p allows you to add changes hunk by hunk. So you could add just the doc typo fixes and commit them. Then just the small bug fixes and commit those. Then add just the method renaming, and commit. Finally you've got just your feature changes as a clean, easy to understand commit.
git statusand the content of your.gitignore? Also why do you believegit add .is not adding the files? It's normal forgit addto report nothing when it works.