0

I have the following folder structure running on an NGINX server.

-- Laravel installation
-- Magento installation [DOCUMENT ROOT]
    -- Laravel's public folder renamed to a different name
        -- WordPress installation

The website structure goes something like:

www.example.com = Magento
www.example.com/subsite = Laravel [This is its 'public' folder.
    Rest of the folders are placed in a separate folder]
www.example.com/subsite/blogsite = WordPress [Running inside of Laravel]

I had to do the Laravel folder separation because I wanted to make it work as a subdirectory but somehow couldn't figure out how to do it. So I instead followed the Method #1 in this post.

The challenge now is to manage these 3 repositories separately.

I have two major concerns:

  1. How do I track the stranded Laravel public folder which is now inside the Magento repository?
  2. How can I manage the WordPress installation as another separate repository?
Hitesh
  • 330
  • 1
  • 4
  • 10

1 Answers1

0

1. How do I track the stranded Laravel public folder which is now inside the Magento repository?

As per this answer, you can add external directories to your working tree with this git command:

git --work-tree=/ add /home/some/directory

2. How can I manage the WordPress installation as another separate repository?

You can use .gitignore to ignore the subfolder in the Magento subfolder.

  1. In the Magento root, create a file named .gitignore
  2. In this file, create a list of folders/files you want to ignore, in your case you want to ignore the Wordpress folder within the Laravel directory (assuming it's under public/wordpress.

    /public/wordpress/
    /public/wordpress/*
    
  3. Do a git commit: git commit -am 'Ignore the Wordpress folder'

Now you can just create a seperate git tracking instance on the Wordpress folder.

Community
  • 1
  • 1
Axel
  • 10,732
  • 2
  • 30
  • 43
  • I got the `wordpress` repository working inside of the `/public/` folder. But cannot get the `public` directory to track inside `laravel` repository. It still gets tracked in the `magento` repository and when I do the `git--work-tree ...` command in `laravel` repository like you suggested, it shows files inside the `public` folder as `deleted`. And these files are also getting tracked inside `magento` repository. – Hitesh Jan 27 '15 at 12:38