how to add a new project to GIT?(from the IDE)

os: kubuntu 10.04
PhpStorm 2.0beta
build PS-98.191

I have a new project that its just me that is working on it.
I have git installed on my local machine.

What i wanted to do was to add the local projet into git so i could have access to history comparison for the code.

The steps i took were these:
* Selected the root directory of the project and hit OK
* In the console i started getting these messages:

10:11:38.709: cd /home/me/PhpStorm_projects/
10:11:38.709: git log --max-count=51 --before=1288141108 --all --name-only --pretty=format:%x01%h%x02%H%x02%ct%x02%an%x02%ae%x02%cn%x02%ce%x02%p%x02%d%x02%s%x02%b%x03 --encoding=UTF-8 -- .
fatal: bad default revision 'HEAD'

10:12:38.813: cd /home/me/PhpStorm_projects/
10:12:38.813: git log --max-count=51 --before=1288141108 --all --name-only --pretty=format:%x01%h%x02%H%x02%ct%x02%an%x02%ae%x02%cn%x02%ce%x02%p%x02%d%x02%s%x02%b%x03 --encoding=UTF-8 -- .
fatal: bad default revision 'HEAD'

10:13:38.920: cd /home/me/PhpStorm_projects/
10:13:38.921: git log --max-count=51 --before=1288141108 --all --name-only --pretty=format:%x01%h%x02%H%x02%ct%x02%an%x02%ae%x02%cn%x02%ce%x02%p%x02%d%x02%s%x02%b%x03 --encoding=UTF-8 -- .
fatal: bad default revision 'HEAD'

If i try to re-initialize the same directory it says its already under git.

what am i missing?

1 comment
Comment actions Permalink

sorry, cant edit the post so reply.

I got it working by:
* closing phpstorm
* going to console
* moving the .idea directory out of the project root
* in the console going into the project root directory  (phpstorm had already run a 'git init' for me on this direcrtoy)
* do 'git add .'
* do 'git commit'
* move the .idea directory back into the root directory.
* create a .gitignore file with the contents
* restart phpstorm.

now "show history for section" is working. :)


Please sign in to leave a comment.