Search code examples
cakephppluginsmigrationcakephp-2.0cakedc

Why isn't GIT tracking my cakephp migrations Plugin?


I am using GIT to deploy my cakephp applications, a few days ago I started using the migrations plugin (by cakeDC) in my app to simplify database versions and changes.

After installing the Migrations Plugin on my local development machine, I committed the changes and pushed it to my production server, and tried to run the migrations plugin from there. After looking at the server for quite some time I realized it had not grabbed all of the migrations plugin, however the following were changed:

app/Config/bootstrap.php had the following line appended CakePlugin::load('Migrations');

The Plugin folder now had a Migrations folder, but it was empty.

I resolved this by uploading the plugin via FTP. I ran a git status on it and it shows the working directory clean...

Why isnt GIT tracking my Migrations plugin folder contents?


Solution

  • The Plugin folder is not being tracked because GIT thought it was a submodule.

    I ran into this issue because I used GIT to clone this Plugin into the plugin directory. and git didnt add it since it was a repository in itself. When GIT didnt add it to my tracked files I did it manually: git add app/Plugin/Migrations/ this created a gitlink and essentially acted like a submodule, as seen in this thread:

    Git - how to track untracked content?

    Since at the time I didnt want to use the plugin as a submodule, I corrected this issue with the following commands:

    git rm --cached app/Plugin/Migrations

    with a git status I could see that GIT was now recognizing my Plugin

    I then could proceed with a git add . and git commit -m "finally adding the plugin"

    I hope this helps someone in the future.

    Thanks!