Intellij IDEA: fatal: bad revision 'HEAD'
You can't just create a git directory on a parent directory of a repository, and expect things to work. It would help to know what you are actually trying to achieve, but a wild guess is that you probably want to have a look at git submodules.