Yii With Git

As you know


yiic webapp test git

command creates a test application with git related files (.gitignore etc.)

But created my application with


yiic webapp test

, because of this, i don’t have git files. I will use git, now, is there a command for creating git related files (.gitignore, .gitkeep etc.) for my already created test application?

If there isn’t, i’ll create a new app with


yiic webapp test git

, and then copy my protected directory from old to new app.

How about just running a ‘git init && touch .gitignore’ in the directory?

I didn’t know that Yii now generates a git repo when you pass the ‘git’ argument. :)

It’s creating custom .gitignore and .gitkeep files for Yii. But ‘touch .gitignore’ creates an empty .gitignore file, i will have to fill it manually.

http://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app

You could take a look at the code for the command which performs the ‘git’ step :)

I need to update my own copy of Yii - it’s in yii/framework/cli/commands/WebAppCommand.php I guess.

You could just copy the relevant code into a new command class - named GitifyCommand maybe? and use it to add git to existing projects.