I started working on a project recently, then decided to push it up to github. So I did the following:
cd git init git add -A git commit -m \'me
A subfolder will not be added with git add . (or similar commands) if it contains a .git dir because it will be assumed to be a git submodule.
git add .
.git
You can rm -rf .git in the subfolder if it's not supposed to be a submodule.
rm -rf .git